2019-10-22 04:09:04 +08:00
|
|
|
|
/******************************************/
|
|
|
|
|
|
/* */
|
|
|
|
|
|
/* Copyright (c) 2018 monitor1394 */
|
|
|
|
|
|
/* https://github.com/monitor1394 */
|
|
|
|
|
|
/* */
|
|
|
|
|
|
/******************************************/
|
|
|
|
|
|
|
|
|
|
|
|
using UnityEngine;
|
2019-05-11 04:33:54 +08:00
|
|
|
|
|
|
|
|
|
|
namespace XCharts
|
|
|
|
|
|
{
|
2019-07-15 00:24:04 +08:00
|
|
|
|
[AddComponentMenu("XCharts/BarChart", 14)]
|
2019-05-11 04:33:54 +08:00
|
|
|
|
[ExecuteInEditMode]
|
|
|
|
|
|
[RequireComponent(typeof(RectTransform))]
|
|
|
|
|
|
[DisallowMultipleComponent]
|
|
|
|
|
|
public class BarChart : CoordinateChart
|
|
|
|
|
|
{
|
2019-05-15 09:44:18 +08:00
|
|
|
|
|
2019-07-15 00:24:04 +08:00
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
|
|
protected override void Reset()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.Reset();
|
2019-07-15 19:21:22 +08:00
|
|
|
|
m_Title.text = "BarChart";
|
2019-07-18 09:42:36 +08:00
|
|
|
|
m_Tooltip.type = Tooltip.Type.Shadow;
|
2019-07-15 00:24:04 +08:00
|
|
|
|
RemoveData();
|
2019-09-29 09:16:15 +08:00
|
|
|
|
AddSerie(SerieType.Bar, "serie1");
|
2019-07-15 00:24:04 +08:00
|
|
|
|
for (int i = 0; i < 5; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
AddXAxisData("x" + (i + 1));
|
|
|
|
|
|
AddData(0, Random.Range(10, 90));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
2019-05-11 04:33:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|