mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-30 13:28:47 +00:00
更新文档
This commit is contained in:
@@ -5,12 +5,13 @@ using XCharts;
|
|||||||
[ExecuteInEditMode]
|
[ExecuteInEditMode]
|
||||||
public class Demo10_LineSimple : MonoBehaviour
|
public class Demo10_LineSimple : MonoBehaviour
|
||||||
{
|
{
|
||||||
//void Awake()
|
void Awake()
|
||||||
void Start()
|
|
||||||
{
|
{
|
||||||
var chart = gameObject.GetComponent<LineChart>();
|
var chart = gameObject.GetComponent<LineChart>();
|
||||||
if (chart == null) return;
|
if (chart == null)
|
||||||
|
{
|
||||||
|
chart = gameObject.AddComponent<LineChart>();
|
||||||
|
}
|
||||||
chart.title.show = true;
|
chart.title.show = true;
|
||||||
chart.title.text = "Line Simple";
|
chart.title.text = "Line Simple";
|
||||||
|
|
||||||
@@ -21,17 +22,15 @@ public class Demo10_LineSimple : MonoBehaviour
|
|||||||
chart.xAxises[1].show = false;
|
chart.xAxises[1].show = false;
|
||||||
chart.yAxises[0].show = true;
|
chart.yAxises[0].show = true;
|
||||||
chart.yAxises[1].show = false;
|
chart.yAxises[1].show = false;
|
||||||
|
|
||||||
chart.xAxises[0].type = Axis.AxisType.Category;
|
chart.xAxises[0].type = Axis.AxisType.Category;
|
||||||
chart.yAxises[0].type = Axis.AxisType.Value;
|
chart.yAxises[0].type = Axis.AxisType.Value;
|
||||||
|
|
||||||
int dataCount = 10;
|
chart.xAxises[0].splitNumber = 10;
|
||||||
chart.xAxises[0].splitNumber = dataCount;
|
|
||||||
chart.xAxises[0].boundaryGap = true;
|
chart.xAxises[0].boundaryGap = true;
|
||||||
|
|
||||||
chart.RemoveData();
|
chart.RemoveData();
|
||||||
chart.AddSerie(SerieType.Line);
|
chart.AddSerie(SerieType.Line);
|
||||||
for (int i = 0; i < dataCount; i++)
|
for (int i = 0; i < 10; i++)
|
||||||
{
|
{
|
||||||
chart.AddXAxisData("x" + i);
|
chart.AddXAxisData("x" + i);
|
||||||
chart.AddData(0, Random.Range(10, 20));
|
chart.AddData(0, Random.Range(10, 20));
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace XCharts
|
|||||||
[Serializable]
|
[Serializable]
|
||||||
public class Grid : IEquatable<Grid>
|
public class Grid : IEquatable<Grid>
|
||||||
{
|
{
|
||||||
[SerializeField] private bool m_Show;
|
[SerializeField] private bool m_Show = true;
|
||||||
[SerializeField] private float m_Left;
|
[SerializeField] private float m_Left;
|
||||||
[SerializeField] private float m_Right;
|
[SerializeField] private float m_Right;
|
||||||
[SerializeField] private float m_Top;
|
[SerializeField] private float m_Top;
|
||||||
|
|||||||
Reference in New Issue
Block a user