增加Chart的更多快捷创建图表菜单

This commit is contained in:
monitor1394
2024-01-13 22:37:13 +08:00
parent fff04347fa
commit 9a56985b3a
16 changed files with 722 additions and 13 deletions

View File

@@ -2,6 +2,10 @@ using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// Ring chart is mainly used to show the proportion of each item and the relationship between the items.
/// || 环形图主要用于显示每一项的比例以及各项之间的关系。
/// </summary>
[AddComponentMenu("XCharts/RingChart", 20)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
@@ -15,5 +19,18 @@ namespace XCharts.Runtime
RemoveData();
Ring.AddDefaultSerie(this, GenerateDefaultSerieName());
}
/// <summary>
/// default multiple ring chart.
/// || 默认多圆环图。
/// </summary>
public void DefaultMultipleRingChart()
{
CheckChartInit();
var serie = GetSerie(0);
serie.label.show = false;
AddData(0, UnityEngine.Random.Range(30, 90), 100, "data2");
AddData(0, UnityEngine.Random.Range(30, 90), 100, "data3");
}
}
}