mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-15 21:00:11 +00:00
重构Component相关代码,调整API接口
This commit is contained in:
@@ -33,22 +33,22 @@ namespace XCharts.Example
|
||||
chart.Init();
|
||||
chart.SetSize(1200, 600);
|
||||
}
|
||||
var title = chart.GetOrAddChartComponent<Title>();
|
||||
var title = chart.EnsureChartComponent<Title>();
|
||||
title.text = "Simple LineChart";
|
||||
title.subText = "normal line";
|
||||
|
||||
var tooltip = chart.GetOrAddChartComponent<Tooltip>();
|
||||
var tooltip = chart.EnsureChartComponent<Tooltip>();
|
||||
tooltip.show = true;
|
||||
|
||||
var legend = chart.GetOrAddChartComponent<Legend>();
|
||||
var legend = chart.EnsureChartComponent<Legend>();
|
||||
legend.show = false;
|
||||
|
||||
var xAxis = chart.GetOrAddChartComponent<XAxis>();
|
||||
var xAxis = chart.EnsureChartComponent<XAxis>();
|
||||
xAxis.splitNumber = 10;
|
||||
xAxis.boundaryGap = true;
|
||||
xAxis.type = Axis.AxisType.Category;
|
||||
|
||||
var yAxis = chart.GetOrAddChartComponent<YAxis>();
|
||||
var yAxis = chart.EnsureChartComponent<YAxis>();
|
||||
yAxis.type = Axis.AxisType.Value;
|
||||
|
||||
chart.RemoveData();
|
||||
|
||||
Reference in New Issue
Block a user