mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-27 11:40:13 +00:00
3.0 - unitypackage
This commit is contained in:
37
Runtime/Serie/Bar/Bar.cs
Normal file
37
Runtime/Serie/Bar/Bar.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
[System.Serializable]
|
||||
[SerieHandler(typeof(BarHandler), true)]
|
||||
[SerieConvert(typeof(Line), typeof(Pie))]
|
||||
[RequireChartComponent(typeof(GridCoord))]
|
||||
[DefaultAnimation(AnimationType.BottomToTop)]
|
||||
[SerieExtraComponent(
|
||||
typeof(LabelStyle),
|
||||
typeof(IconStyle),
|
||||
typeof(Emphasis))]
|
||||
public class Bar : Serie, INeedSerieContainer, ISimplifiedSerie
|
||||
{
|
||||
public int containerIndex { get; internal set; }
|
||||
public int containterInstanceId { get; internal set; }
|
||||
|
||||
public static void AddDefaultSerie(BaseChart chart, string serieName)
|
||||
{
|
||||
var serie = chart.AddSerie<Bar>(serieName);
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
chart.AddData(serie.index, UnityEngine.Random.Range(10, 90));
|
||||
}
|
||||
}
|
||||
|
||||
public static Bar CovertSerie(Serie serie)
|
||||
{
|
||||
var newSerie = SerieHelper.CloneSerie<Bar>(serie);
|
||||
return newSerie;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user