Files
XCharts/Runtime/Serie/Bar/Bar.cs

32 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]
[SerieHandler(typeof(BarHandler), true)]
2021-12-31 13:00:17 +08:00
[SerieConvert(typeof(Line), typeof(Pie))]
[CoordOptions(typeof(GridCoord), typeof(PolarCoord))]
2021-12-12 18:05:26 +08:00
[DefaultAnimation(AnimationType.BottomToTop)]
[SerieExtraComponent(typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
2022-05-22 22:17:38 +08:00
[SerieDataExtraField("m_Ignore")]
2022-01-13 21:45:59 +08:00
public class Bar : Serie, INeedSerieContainer
2021-11-23 13:20:07 +08:00
{
public int containerIndex { get; internal set; }
public int containterInstanceId { get; internal set; }
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<Bar>(serieName);
for (int i = 0; i < 5; i++)
{
chart.AddData(serie.index, UnityEngine.Random.Range(10, 90));
}
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 Bar CovertSerie(Serie serie)
{
var newSerie = SerieHelper.CloneSerie<Bar>(serie);
return newSerie;
}
2021-11-23 13:20:07 +08:00
}
}