mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-15 04:20:09 +00:00
屏蔽Chart的Init()接口,动态创建图表不再需要调用
This commit is contained in:
@@ -25,11 +25,10 @@ namespace XCharts.Example
|
||||
|
||||
void AddData()
|
||||
{
|
||||
var chart = gameObject.GetComponent<SimplifiedLineChart>();
|
||||
var chart = gameObject.GetComponent<LineChart>();
|
||||
if (chart == null)
|
||||
{
|
||||
chart = gameObject.AddComponent<SimplifiedLineChart>();
|
||||
chart.Init();
|
||||
chart = gameObject.AddComponent<LineChart>();
|
||||
chart.SetSize(580, 300);
|
||||
}
|
||||
chart.EnsureChartComponent<Title>().show = true;
|
||||
@@ -49,9 +48,9 @@ namespace XCharts.Example
|
||||
xAxis.boundaryGap = true;
|
||||
|
||||
chart.RemoveData();
|
||||
chart.AddSerie<SimplifiedLine>();
|
||||
chart.AddSerie<SimplifiedLine>();
|
||||
for (int i = 0; i < 200; i++)
|
||||
chart.AddSerie<Line>();
|
||||
chart.AddSerie<Line>();
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
chart.AddXAxisData("x" + i);
|
||||
chart.AddData(0, Random.Range(10, 20));
|
||||
|
||||
Reference in New Issue
Block a user