mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-23 09:20:08 +00:00
增加LineChart可通过VisualMap或ItemStyle配置渐变#78
This commit is contained in:
@@ -43,7 +43,7 @@ namespace XCharts
|
||||
{
|
||||
EditorGUILayout.PropertyField(m_DataZoom);
|
||||
}
|
||||
if (m_Target is HeatmapChart)
|
||||
if (m_Target is HeatmapChart || m_Target is LineChart)
|
||||
{
|
||||
EditorGUILayout.PropertyField(m_VisualMap);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace XCharts
|
||||
SerializedProperty show = prop.FindPropertyRelative("m_Show");
|
||||
SerializedProperty m_Color = prop.FindPropertyRelative("m_Color");
|
||||
SerializedProperty m_ToColor = prop.FindPropertyRelative("m_ToColor");
|
||||
SerializedProperty m_ToColor2 = prop.FindPropertyRelative("m_ToColor2");
|
||||
SerializedProperty m_BackgroundColor = prop.FindPropertyRelative("m_BackgroundColor");
|
||||
SerializedProperty m_BackgroundWidth = prop.FindPropertyRelative("m_BackgroundWidth");
|
||||
SerializedProperty m_CenterColor = prop.FindPropertyRelative("m_CenterColor");
|
||||
@@ -45,6 +46,8 @@ namespace XCharts
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_ToColor);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_ToColor2);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_BackgroundColor);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_BackgroundWidth);
|
||||
@@ -80,7 +83,7 @@ namespace XCharts
|
||||
float height = 0;
|
||||
if (ChartEditorHelper.IsToggle(m_ItemStyleToggle, prop))
|
||||
{
|
||||
height += 14 * EditorGUIUtility.singleLineHeight + 13 * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += 15 * EditorGUIUtility.singleLineHeight + 14 * EditorGUIUtility.standardVerticalSpacing;
|
||||
var m_CornerRadius = prop.FindPropertyRelative("m_CornerRadius");
|
||||
if (ChartEditorHelper.IsToggle(m_CornerRadiusToggle, m_CornerRadius))
|
||||
{
|
||||
|
||||
@@ -42,7 +42,9 @@ namespace XCharts
|
||||
SerializedProperty m_Orient = prop.FindPropertyRelative("m_Orient");
|
||||
SerializedProperty m_Location = prop.FindPropertyRelative("m_Location");
|
||||
SerializedProperty m_InRange = prop.FindPropertyRelative("m_InRange");
|
||||
// SerializedProperty m_OutOfRange = prop.FindPropertyRelative("m_OutOfRange");
|
||||
SerializedProperty m_AutoMinMax = prop.FindPropertyRelative("m_AutoMinMax");
|
||||
SerializedProperty m_Direction = prop.FindPropertyRelative("m_Direction");
|
||||
SerializedProperty m_OutOfRange = prop.FindPropertyRelative("m_OutOfRange");
|
||||
|
||||
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_VisualMapModuleToggle, "Visual Map", m_Enable);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
@@ -51,7 +53,10 @@ namespace XCharts
|
||||
++EditorGUI.indentLevel;
|
||||
EditorGUI.PropertyField(drawRect, m_Type);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
|
||||
EditorGUI.PropertyField(drawRect, m_Direction);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_AutoMinMax);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_Min);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_Max);
|
||||
@@ -60,8 +65,6 @@ namespace XCharts
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_Dimension);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_HoverLink);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
|
||||
m_InRangeFoldout = EditorGUI.Foldout(drawRect, m_InRangeFoldout, "InRange");
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
@@ -71,12 +74,12 @@ namespace XCharts
|
||||
}
|
||||
|
||||
// drawRect.width = pos.width;
|
||||
// m_OutOfRangeFoldout = EditorGUI.Foldout(drawRect, m_OutOfRangeFoldout, "OutOfRange");
|
||||
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
// if (m_OutOfRangeFoldout)
|
||||
// {
|
||||
// ChartEditorHelper.MakeList(ref drawRect, ref m_OutOfRangeSize, m_OutOfRange);
|
||||
// }
|
||||
m_OutOfRangeFoldout = EditorGUI.Foldout(drawRect, m_OutOfRangeFoldout, "OutOfRange");
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
if (m_OutOfRangeFoldout)
|
||||
{
|
||||
ChartEditorHelper.MakeList(ref drawRect, ref m_OutOfRangeSize, m_OutOfRange);
|
||||
}
|
||||
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
|
||||
EditorGUI.PropertyField(drawRect, m_Show);
|
||||
@@ -88,6 +91,8 @@ namespace XCharts
|
||||
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Range, "Range");
|
||||
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Text, "Text");
|
||||
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Text, "TextGap");
|
||||
EditorGUI.PropertyField(drawRect, m_HoverLink);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_Calculable);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_ItemWidth);
|
||||
@@ -111,7 +116,7 @@ namespace XCharts
|
||||
int num = 1;
|
||||
if (m_VisualMapModuleToggle)
|
||||
{
|
||||
num += 8;
|
||||
num += 10;
|
||||
height += num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
|
||||
|
||||
if (m_InRangeFoldout)
|
||||
@@ -121,16 +126,16 @@ namespace XCharts
|
||||
height += size * EditorGUIUtility.singleLineHeight + (size - 1) * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += EditorGUIUtility.standardVerticalSpacing;
|
||||
}
|
||||
// if (m_OutOfRangeFoldout)
|
||||
// {
|
||||
// SerializedProperty m_OutOfRange = prop.FindPropertyRelative("m_OutOfRange");
|
||||
// int size = m_OutOfRange.arraySize + 1;
|
||||
// height += size * EditorGUIUtility.singleLineHeight + (size - 1) * EditorGUIUtility.standardVerticalSpacing;
|
||||
// height += EditorGUIUtility.standardVerticalSpacing;
|
||||
// }
|
||||
if (m_OutOfRangeFoldout)
|
||||
{
|
||||
SerializedProperty m_OutOfRange = prop.FindPropertyRelative("m_OutOfRange");
|
||||
int size = m_OutOfRange.arraySize + 1;
|
||||
height += size * EditorGUIUtility.singleLineHeight + (size - 1) * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += EditorGUIUtility.standardVerticalSpacing;
|
||||
}
|
||||
if (prop.FindPropertyRelative("m_Show").boolValue)
|
||||
{
|
||||
height += 9 * EditorGUIUtility.singleLineHeight + 8 * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += 10 * EditorGUIUtility.singleLineHeight + 9 * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Location"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user