Files
XCharts/Runtime/LineChart.cs
2019-10-23 18:59:34 +08:00

37 lines
972 B
C#

/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEngine;
namespace XCharts
{
[AddComponentMenu("XCharts/LineChart", 13)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
[DisallowMultipleComponent]
public class LineChart : CoordinateChart
{
#if UNITY_EDITOR
protected override void Reset()
{
base.Reset();
m_Title.text = "LineChart";
m_Tooltip.type = Tooltip.Type.Line;
RemoveData();
AddSerie(SerieType.Line, "serie1");
for (int i = 0; i < 5; i++)
{
AddXAxisData("x" + (i + 1));
AddData(0, UnityEngine.Random.Range(10, 90));
}
}
#endif
}
}