This commit is contained in:
monitor1394
2024-01-21 22:33:45 +08:00
parent e68e41a939
commit 653b81cc48
17 changed files with 41 additions and 11 deletions

View File

@@ -38,7 +38,11 @@ namespace XCharts.Example
IEnumerator AddSimpleBar()
{
chart = gameObject.GetComponent<BarChart>();
if (chart == null) chart = gameObject.AddComponent<BarChart>();
if (chart == null)
{
chart = gameObject.AddComponent<BarChart>();
chart.Init();
}
chart.EnsureChartComponent<Title>().text = "BarChart - 柱状图";
chart.EnsureChartComponent<Title>().subText = "普通柱状图";