增加CandlestickChartK线图 #124

This commit is contained in:
monitor1394
2021-03-10 13:03:36 +08:00
parent 0eeacdebe7
commit 555e6d47ca
28 changed files with 708 additions and 22 deletions

View 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;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1bc2ab7ace40d480e839052673b65a5d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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;
}
}

View File

@@ -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");

View File

@@ -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;
}

View File

@@ -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()
{