重构Component相关代码,调整API接口

This commit is contained in:
monitor1394
2023-02-12 21:22:53 +08:00
parent 22b167981b
commit 4964bca341
57 changed files with 349 additions and 185 deletions

View File

@@ -32,14 +32,14 @@ namespace XCharts.Example
chart.Init();
chart.SetSize(580, 300);
}
chart.GetOrAddChartComponent<Title>().show = true;
chart.GetOrAddChartComponent<Title>().text = "Line Simple";
chart.EnsureChartComponent<Title>().show = true;
chart.EnsureChartComponent<Title>().text = "Line Simple";
chart.GetOrAddChartComponent<Tooltip>().show = true;
chart.GetOrAddChartComponent<Legend>().show = false;
chart.EnsureChartComponent<Tooltip>().show = true;
chart.EnsureChartComponent<Legend>().show = false;
var xAxis = chart.GetOrAddChartComponent<XAxis>();
var yAxis = chart.GetOrAddChartComponent<YAxis>();
var xAxis = chart.EnsureChartComponent<XAxis>();
var yAxis = chart.EnsureChartComponent<YAxis>();
xAxis.show = true;
yAxis.show = true;
xAxis.type = Axis.AxisType.Category;