Files
ZHGD_Web/SelfPackages/XCharts/Runtime/Chart/CandlestickChart.cs
2025-07-13 23:16:20 +08:00

30 lines
1.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// A candlestick chart is a style of financial chart used to describe price movements of a security, derivative, or currency.
/// || 蜡烛图也叫K线图用于描述证券、衍生品或货币的价格走势的一种金融图表样式。
/// </summary>
[AddComponentMenu("XCharts/CandlestickChart", 23)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
[DisallowMultipleComponent]
[HelpURL("https://xcharts-team.github.io/docs/configuration")]
public class CandlestickChart : BaseChart
{
protected override void DefaultChart()
{
EnsureChartComponent<GridCoord>();
EnsureChartComponent<XAxis>();
EnsureChartComponent<YAxis>();
RemoveData();
var serie = Candlestick.AddDefaultSerie(this, GenerateDefaultSerieName());
for (int i = 0; i < serie.dataCount; i++)
{
AddXAxisData("x" + (i + 1));
}
}
}
}