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

36 lines
1.4 KiB
C#
Raw Normal View History

2021-11-23 13:20:07 +08:00
using System;
2022-02-19 22:37:57 +08:00
namespace XCharts.Runtime
2021-11-23 13:20:07 +08:00
{
[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))]
[DefaultAnimation(AnimationType.LeftToRight, false)]
[DefaultTooltip(Tooltip.Type.Line, Tooltip.Trigger.Axis)]
[SerieDataExtraField("m_State", "m_Ignore")]
[SerieComponent(typeof(LabelStyle), typeof(EndLabelStyle), typeof(LineArrow), typeof(AreaStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(SerieSymbol), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
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; }
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<Line>(serieName);
serie.symbol.show = true;
2023-07-31 07:29:53 +08:00
serie.animation.interaction.radius.value = 1.5f;
2021-11-23 13:20:07 +08:00
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
2022-12-22 22:26:10 +08:00
public static Line ConvertSerie(Serie serie)
2021-12-09 21:35:23 +08:00
{
var newSerie = serie.Clone<Line>();
return newSerie;
}
2021-11-23 13:20:07 +08:00
}
}