mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-15 04:20:09 +00:00
36 lines
937 B
C#
36 lines
937 B
C#
|
|
|
|
using UnityEngine;
|
|
|
|
namespace XCharts.Runtime
|
|
{
|
|
[AddComponentMenu("XCharts/SimplifiedLineChart", 26)]
|
|
[ExecuteInEditMode]
|
|
[RequireComponent(typeof(RectTransform))]
|
|
[DisallowMultipleComponent]
|
|
public class SimplifiedLineChart : BaseChart
|
|
{
|
|
|
|
#if UNITY_EDITOR
|
|
protected override void Reset()
|
|
{
|
|
base.Reset();
|
|
AddChartComponentWhenNoExist<GridCoord>();
|
|
AddChartComponentWhenNoExist<XAxis>();
|
|
AddChartComponentWhenNoExist<YAxis>();
|
|
|
|
var tooltip = GetChartComponent<Tooltip>();
|
|
tooltip.type = Tooltip.Type.Line;
|
|
tooltip.trigger = Tooltip.Trigger.Axis;
|
|
|
|
RemoveData();
|
|
SimplifiedLine.AddDefaultSerie(this, GenerateDefaultSerieName());
|
|
for (int i = 0; i < GetSerie(0).dataCount; i++)
|
|
{
|
|
AddXAxisData("x" + (i + 1));
|
|
}
|
|
}
|
|
#endif
|
|
}
|
|
}
|