2021-12-31 13:00:17 +08:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
2022-02-19 22:37:57 +08:00
|
|
|
namespace XCharts.Runtime
|
2021-12-31 13:00:17 +08:00
|
|
|
{
|
|
|
|
|
[AddComponentMenu("XCharts/SimplifiedCandlestickChart", 28)]
|
|
|
|
|
[ExecuteInEditMode]
|
|
|
|
|
[RequireComponent(typeof(RectTransform))]
|
|
|
|
|
[DisallowMultipleComponent]
|
|
|
|
|
public class SimplifiedCandlestickChart : BaseChart
|
|
|
|
|
{
|
2022-03-20 18:52:50 +08:00
|
|
|
protected override void DefaultChart()
|
2021-12-31 13:00:17 +08:00
|
|
|
{
|
|
|
|
|
AddChartComponentWhenNoExist<GridCoord>();
|
|
|
|
|
AddChartComponentWhenNoExist<XAxis>();
|
|
|
|
|
AddChartComponentWhenNoExist<YAxis>();
|
|
|
|
|
|
|
|
|
|
var tooltip = GetChartComponent<Tooltip>();
|
|
|
|
|
tooltip.type = Tooltip.Type.Shadow;
|
|
|
|
|
tooltip.trigger = Tooltip.Trigger.Axis;
|
|
|
|
|
|
|
|
|
|
RemoveData();
|
|
|
|
|
SimplifiedCandlestick.AddDefaultSerie(this, GenerateDefaultSerieName());
|
|
|
|
|
for (int i = 0; i < GetSerie(0).dataCount; i++)
|
|
|
|
|
{
|
|
|
|
|
AddXAxisData("x" + (i + 1));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-05-22 22:17:38 +08:00
|
|
|
}
|