mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-20 07:20:08 +00:00
增加Formatter配置SerieLabel、Legend的格式化输出
This commit is contained in:
@@ -24,6 +24,7 @@ namespace XCharts
|
||||
SerializedProperty itemHeight = prop.FindPropertyRelative("m_ItemHeight");
|
||||
SerializedProperty itemGap = prop.FindPropertyRelative("m_ItemGap");
|
||||
SerializedProperty itemFontSize = prop.FindPropertyRelative("m_ItemFontSize");
|
||||
SerializedProperty m_Formatter = prop.FindPropertyRelative("m_Formatter");
|
||||
SerializedProperty m_Data = prop.FindPropertyRelative("m_Data");
|
||||
|
||||
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_LegendModuleToggle, "Legend", show);
|
||||
@@ -45,6 +46,8 @@ namespace XCharts
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, location);
|
||||
drawRect.y += EditorGUI.GetPropertyHeight(location);
|
||||
EditorGUI.PropertyField(drawRect, m_Formatter);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
drawRect.width = EditorGUIUtility.labelWidth + 10;
|
||||
m_DataFoldout = EditorGUI.Foldout(drawRect, m_DataFoldout, "Data");
|
||||
ChartEditorHelper.MakeJsonData(ref drawRect, ref m_ShowJsonDataArea, ref m_JsonDataAreaText, prop,pos.width);
|
||||
@@ -63,7 +66,7 @@ namespace XCharts
|
||||
if (m_LegendModuleToggle)
|
||||
{
|
||||
SerializedProperty location = prop.FindPropertyRelative("m_Location");
|
||||
height += 6 * EditorGUIUtility.singleLineHeight + 5 * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += 7 * EditorGUIUtility.singleLineHeight + 6 * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += EditorGUI.GetPropertyHeight(location);
|
||||
height += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
if (m_DataFoldout)
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace XCharts
|
||||
drawRect.height = EditorGUIUtility.singleLineHeight;
|
||||
SerializedProperty show = prop.FindPropertyRelative("m_Show");
|
||||
SerializedProperty m_Position = prop.FindPropertyRelative("m_Position");
|
||||
SerializedProperty m_Formatter = prop.FindPropertyRelative("m_Formatter");
|
||||
SerializedProperty m_Distance = prop.FindPropertyRelative("m_Distance");
|
||||
SerializedProperty m_Rotate = prop.FindPropertyRelative("m_Rotate");
|
||||
SerializedProperty m_PaddingLeftRight = prop.FindPropertyRelative("m_PaddingLeftRight");
|
||||
@@ -40,6 +41,8 @@ namespace XCharts
|
||||
++EditorGUI.indentLevel;
|
||||
EditorGUI.PropertyField(drawRect, m_Position);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_Formatter);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_Distance);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_Color);
|
||||
@@ -83,7 +86,7 @@ namespace XCharts
|
||||
float height = 0;
|
||||
if (ChartEditorHelper.IsToggle(m_SerieLabelToggle, prop))
|
||||
{
|
||||
height += 19 * EditorGUIUtility.singleLineHeight + 18 * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += 20 * EditorGUIUtility.singleLineHeight + 19 * EditorGUIUtility.standardVerticalSpacing;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user