Files
XCharts/Runtime/LineChart.cs

44 lines
1.2 KiB
C#
Raw Normal View History


2021-01-11 08:54:28 +08:00
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
2019-05-24 09:51:45 +08:00
using UnityEngine;
namespace XCharts
{
2019-07-15 00:24:04 +08:00
[AddComponentMenu("XCharts/LineChart", 13)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
[DisallowMultipleComponent]
public class LineChart : CoordinateChart
{
2019-05-15 09:44:18 +08:00
2019-06-13 09:53:03 +08:00
#if UNITY_EDITOR
protected override void Reset()
{
base.Reset();
2021-01-11 08:54:28 +08:00
title.text = "LineChart";
tooltip.type = Tooltip.Type.Line;
2021-01-11 08:54:28 +08:00
visualMap.enable = false;
visualMap.show = false;
visualMap.autoMinMax = true;
visualMap.inRange.Clear();
visualMap.inRange.Add(Color.blue);
visualMap.inRange.Add(Color.red);
2019-07-15 00:24:04 +08:00
RemoveData();
2021-01-11 08:54:28 +08:00
SerieTemplate.AddDefaultLineSerie(this, "serie1");
2019-07-15 00:24:04 +08:00
for (int i = 0; i < 5; i++)
{
AddXAxisData("x" + (i + 1));
}
}
2019-06-13 09:53:03 +08:00
#endif
}
}