增加PiepieType支持实心饼图和线框柄图 (#349)

This commit is contained in:
monitor1394
2025-10-22 09:06:28 +08:00
parent c83fe89a31
commit c2bafb8aa8
5 changed files with 39 additions and 3 deletions

View File

@@ -2,6 +2,21 @@ using UnityEngine;
namespace XCharts.Runtime
{
public enum PieType
{
/// <summary>
/// solid pie chart - default fill style.
/// ||实心饼图 - 默认填充样式
/// </summary>
Solid,
/// <summary>
/// wireframe pie chart - only show the outline wireframe.
/// ||线框饼图 - 仅显示轮廓线框
/// </summary>
Wireframe
}
[System.Serializable]
[SerieConvert(typeof(Line), typeof(Bar))]
[SerieHandler(typeof(PieHandler), true)]
@@ -12,10 +27,20 @@ namespace XCharts.Runtime
public class Pie : Serie
{
[SerializeField][Since("v3.8.1")] private bool m_RadiusGradient = false;
[SerializeField][Since("v3.15.0")] private PieType m_PieType = PieType.Solid;
public override SerieColorBy defaultColorBy { get { return SerieColorBy.Data; } }
public override bool titleJustForSerie { get { return true; } }
/// <summary>
/// Pie chart type.
/// || 饼图类型。
/// </summary>
public PieType pieType
{
get { return m_PieType; }
set { if (PropertyUtil.SetStruct(ref m_PieType, value)) { SetVerticesDirty(); } }
}
/// <summary>
/// Whether to use gradient color in pie chart.
/// || 是否开启半径方向的渐变效果。