Files
XCharts/Runtime/Serie/Pie/Pie.cs

30 lines
1.2 KiB
C#
Raw Normal View History

2022-02-19 22:37:57 +08:00
namespace XCharts.Runtime
2021-11-23 13:20:07 +08:00
{
[System.Serializable]
2021-12-09 21:35:23 +08:00
[SerieConvert(typeof(Line), typeof(Bar))]
2021-11-23 13:20:07 +08:00
[SerieHandler(typeof(PieHandler), true)]
2021-12-12 18:05:26 +08:00
[DefaultAnimation(AnimationType.Clockwise)]
[SerieExtraComponent(typeof(LabelStyle), typeof(LabelLine), typeof(TitleStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(LabelLine), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
2022-05-22 22:17:38 +08:00
[SerieDataExtraField("m_Ignore", "m_Selected", "m_Radius")]
2021-11-23 13:20:07 +08:00
public class Pie : Serie
{
public override SerieColorBy defaultColorBy { get { return SerieColorBy.Data; } }
2022-05-22 22:17:38 +08:00
public override bool titleJustForSerie { get { return true; } }
2021-12-09 21:35:23 +08:00
2022-01-26 20:47:14 +08:00
public static Serie AddDefaultSerie(BaseChart chart, string serieName)
2021-11-23 13:20:07 +08:00
{
var serie = chart.AddSerie<Pie>(serieName);
chart.AddData(serie.index, 70, "pie1");
chart.AddData(serie.index, 20, "pie2");
chart.AddData(serie.index, 10, "pie3");
2022-01-26 20:47:14 +08:00
return serie;
2021-11-23 13:20:07 +08:00
}
2021-12-09 21:35:23 +08:00
public static Pie CovertSerie(Serie serie)
{
var newSerie = SerieHelper.CloneSerie<Pie>(serie);
return newSerie;
}
2021-11-23 13:20:07 +08:00
}
}