Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Pie.cs 1.2KB

123456789101112131415161718192021222324252627282930
  1. namespace XCharts.Runtime
  2. {
  3. [System.Serializable]
  4. [SerieConvert(typeof(Line), typeof(Bar))]
  5. [SerieHandler(typeof(PieHandler), true)]
  6. [DefaultAnimation(AnimationType.Clockwise)]
  7. [SerieExtraComponent(typeof(LabelStyle), typeof(LabelLine), typeof(TitleStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
  8. [SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(LabelLine), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
  9. [SerieDataExtraField("m_Ignore", "m_Selected", "m_Radius")]
  10. public class Pie : Serie
  11. {
  12. public override SerieColorBy defaultColorBy { get { return SerieColorBy.Data; } }
  13. public override bool titleJustForSerie { get { return true; } }
  14. public static Serie AddDefaultSerie(BaseChart chart, string serieName)
  15. {
  16. var serie = chart.AddSerie<Pie>(serieName);
  17. chart.AddData(serie.index, 70, "pie1");
  18. chart.AddData(serie.index, 20, "pie2");
  19. chart.AddData(serie.index, 10, "pie3");
  20. return serie;
  21. }
  22. public static Pie ConvertSerie(Serie serie)
  23. {
  24. var newSerie = SerieHelper.CloneSerie<Pie>(serie);
  25. return newSerie;
  26. }
  27. }
  28. }