mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-25 02:10:16 +00:00
增加CandlestickChartK线图 #124
This commit is contained in:
24
Editor/CandlestickChartEditor.cs
Normal file
24
Editor/CandlestickChartEditor.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
/************************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 - 2021 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/************************************************/
|
||||
|
||||
using UnityEditor;
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
/// <summary>
|
||||
/// Editor class used to edit UI CandlestickChart.
|
||||
/// </summary>
|
||||
[CustomEditor(typeof(CandlestickChart), false)]
|
||||
public class CandlestickChartEditor : CoordinateChartEditor
|
||||
{
|
||||
protected override void OnEnable()
|
||||
{
|
||||
base.OnEnable();
|
||||
m_Chart = (CandlestickChart)target;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Editor/CandlestickChartEditor.cs.meta
Normal file
11
Editor/CandlestickChartEditor.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1bc2ab7ace40d480e839052673b65a5d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -179,6 +179,11 @@ namespace XCharts
|
||||
PropertyField(prop, "m_ScatterSymbolSelectedSize");
|
||||
PropertyField(prop, "m_PieTooltipExtraRadius");
|
||||
PropertyField(prop, "m_PieSelectedOffset");
|
||||
PropertyField(prop, "m_CandlestickColor");
|
||||
PropertyField(prop, "m_CandlestickColor0");
|
||||
PropertyField(prop, "m_CandlestickBorderColor");
|
||||
PropertyField(prop, "m_CandlestickBorderColor0");
|
||||
PropertyField(prop, "m_CandlestickBorderWidth");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace XCharts
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
PropertyField(prop, "m_Color");
|
||||
PropertyField(prop, "m_Color0");
|
||||
PropertyField(prop, "m_ToColor");
|
||||
PropertyField(prop, "m_ToColor2");
|
||||
PropertyField(prop, "m_BackgroundColor");
|
||||
@@ -31,6 +32,7 @@ namespace XCharts
|
||||
PropertyField(prop, "m_BorderType");
|
||||
PropertyField(prop, "m_BorderWidth");
|
||||
PropertyField(prop, "m_BorderColor");
|
||||
PropertyField(prop, "m_BorderColor0");
|
||||
PropertyField(prop, "m_Opacity");
|
||||
PropertyField(prop, "m_TooltipFormatter");
|
||||
PropertyField(prop, "m_NumericFormatter");
|
||||
|
||||
@@ -182,9 +182,23 @@ namespace XCharts
|
||||
PropertyField(prop, "m_ItemStyle");
|
||||
PropertyField(prop, "m_Label");
|
||||
break;
|
||||
case SerieType.Candlestick:
|
||||
PropertyField(prop, "m_XAxisIndex");
|
||||
PropertyField(prop, "m_YAxisIndex");
|
||||
PropertyFieldLimitMin(prop, "m_MinShow", 0);
|
||||
PropertyFieldLimitMin(prop, "m_MaxShow", 0);
|
||||
PropertyFieldLimitMin(prop, "m_MaxCache", 0);
|
||||
PropertyField(prop, "m_BarWidth");
|
||||
PropertyField(prop, "m_Clip");
|
||||
PropertyField(prop, "m_ShowAsPositiveNumber");
|
||||
PropertyField(prop, "m_Large");
|
||||
PropertyField(prop, "m_LargeThreshold");
|
||||
PropertyField(prop, "m_ItemStyle");
|
||||
PropertyField(prop, "m_Label");
|
||||
PropertyField(prop, "m_Emphasis");
|
||||
break;
|
||||
}
|
||||
PropertyField(prop, "m_Animation");
|
||||
//PropertyListField(prop, "m_Data");
|
||||
DrawData(pos, prop, serieType, ref m_DrawRect);
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
|
||||
@@ -146,6 +146,13 @@ namespace XCharts
|
||||
AddChart<LiquidChart>("LiquidChart");
|
||||
}
|
||||
|
||||
[MenuItem("XCharts/CandlestickChart", priority = 54)]
|
||||
[MenuItem("GameObject/XCharts/CandlestickChart", priority = 54)]
|
||||
public static void AddCandlestickChart()
|
||||
{
|
||||
AddChart<CandlestickChart>("CandlestickChart");
|
||||
}
|
||||
|
||||
[MenuItem("XCharts/Themes Reload")]
|
||||
public static void ReloadTheme()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user