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

28 lines
895 B
C#
Raw Normal View History

2021-11-23 13:20:07 +08:00
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)]
2022-04-26 08:24:45 +08:00
[SerieExtraComponent(typeof(LabelStyle), typeof(LabelLine), typeof(Emphasis))]
2021-11-23 13:20:07 +08:00
public class Pie : Serie
{
2021-12-09 21:35:23 +08:00
public override bool useDataNameForColor { get { return true; } }
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
}
}