Files
XCharts/Runtime/Serie/Line/Line.cs

39 lines
1.1 KiB
C#
Raw Normal View History

2021-11-23 13:20:07 +08:00
using System;
using UnityEngine;
namespace XCharts
{
[Serializable]
[SerieHandler(typeof(LineHandler), true)]
2021-12-09 21:35:23 +08:00
[SerieConvert(typeof(Bar), typeof(Pie))]
2021-11-23 13:20:07 +08:00
[CoordOptions(typeof(GridCoord), typeof(PolarCoord))]
2021-12-12 18:05:26 +08:00
[DefaultAnimation(AnimationType.LeftToRight)]
2021-12-28 08:18:24 +08:00
[SerieExtraComponent(
typeof(LabelStyle),
typeof(EndLabelStyle),
typeof(LineArrow),
typeof(AreaStyle),
typeof(IconStyle),
typeof(Emphasis))]
2021-11-23 13:20:07 +08:00
public class Line : Serie, INeedSerieContainer
{
public int containerIndex { get; internal set; }
public int containterInstanceId { get; internal set; }
public static void AddDefaultSerie(BaseChart chart, string serieName)
{
var serie = chart.AddSerie<Line>(serieName);
serie.symbol.show = true;
for (int i = 0; i < 5; i++)
{
chart.AddData(serie.index, UnityEngine.Random.Range(10, 90));
}
}
2021-12-09 21:35:23 +08:00
public static Line CovertSerie(Serie serie)
{
var newSerie = serie.Clone<Line>();
return newSerie;
}
2021-11-23 13:20:07 +08:00
}
}