mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-25 10:20:10 +00:00
增加科学计数法显示数值的支持
This commit is contained in:
@@ -29,6 +29,7 @@ namespace XCharts
|
||||
SerializedProperty m_Color = prop.FindPropertyRelative("m_Color");
|
||||
SerializedProperty m_FontSize = prop.FindPropertyRelative("m_FontSize");
|
||||
SerializedProperty m_FontStyle = prop.FindPropertyRelative("m_FontStyle");
|
||||
SerializedProperty m_ForceENotation = prop.FindPropertyRelative("m_ForceENotation");
|
||||
|
||||
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_AxisLabelToggle, prop, "Axis Label", show, false);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
@@ -51,6 +52,8 @@ namespace XCharts
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_Formatter);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_ForceENotation);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
@@ -60,7 +63,7 @@ namespace XCharts
|
||||
float height = 0;
|
||||
if (ChartEditorHelper.IsToggle(m_AxisLabelToggle, prop))
|
||||
{
|
||||
height += 8 * EditorGUIUtility.singleLineHeight + 7 * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += 9 * EditorGUIUtility.singleLineHeight + 10 * EditorGUIUtility.standardVerticalSpacing;
|
||||
}
|
||||
return height;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ namespace XCharts
|
||||
SerializedProperty m_Border = prop.FindPropertyRelative("m_Border");
|
||||
SerializedProperty m_BorderWidth = prop.FindPropertyRelative("m_BorderWidth");
|
||||
SerializedProperty m_BorderColor = prop.FindPropertyRelative("m_BorderColor");
|
||||
SerializedProperty m_ForceENotation = prop.FindPropertyRelative("m_ForceENotation");
|
||||
|
||||
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_SerieLabelToggle, prop, null, show, false);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
@@ -100,6 +101,8 @@ namespace XCharts
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_LineLength2);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_ForceENotation);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
@@ -109,7 +112,7 @@ namespace XCharts
|
||||
float height = 0;
|
||||
if (ChartEditorHelper.IsToggle(m_SerieLabelToggle, prop))
|
||||
{
|
||||
height += 22 * EditorGUIUtility.singleLineHeight + 21 * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += 23 * EditorGUIUtility.singleLineHeight + 22 * EditorGUIUtility.standardVerticalSpacing;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace XCharts
|
||||
SerializedProperty m_MinHeight = prop.FindPropertyRelative("m_MinHeight");
|
||||
SerializedProperty m_FontSize = prop.FindPropertyRelative("m_FontSize");
|
||||
SerializedProperty m_FontStyle = prop.FindPropertyRelative("m_FontStyle");
|
||||
SerializedProperty m_ForceENotation = prop.FindPropertyRelative("m_ForceENotation");
|
||||
|
||||
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_TooltipModuleToggle, "Tooltip", show);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
@@ -49,13 +50,15 @@ namespace XCharts
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_FontStyle);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_ForceENotation);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
}
|
||||
}
|
||||
|
||||
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
if (m_TooltipModuleToggle)
|
||||
return 9 * EditorGUIUtility.singleLineHeight + 8 * EditorGUIUtility.standardVerticalSpacing;
|
||||
return 10 * EditorGUIUtility.singleLineHeight + 9 * EditorGUIUtility.standardVerticalSpacing;
|
||||
else
|
||||
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user