From cb86799e44b6e2ab90626802ff70ff57fd9859e9 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Tue, 10 Mar 2020 12:35:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0`LineChart`=E7=9A=84=E6=99=AE?= =?UTF-8?q?=E9=80=9A=E6=8A=98=E7=BA=BF=E5=9B=BE=E5=8F=AF=E9=80=9A=E8=BF=87?= =?UTF-8?q?`ignore`=E5=8F=82=E6=95=B0=E8=AE=BE=E7=BD=AE=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- Documentation/XCharts配置项手册.md | 6 +++--- Editor/PropertyDrawers/SerieDrawer.cs | 8 ++++---- Editor/PropertyDrawers/TooltipDrawer.cs | 4 ++-- Runtime/Component/Main/Serie.cs | 22 +++++++++++----------- Runtime/Component/Main/Tooltip.cs | 4 ++-- Runtime/Internal/CoordinateChart.cs | 2 +- Runtime/Utility/ChartHelper.cs | 2 +- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b09b5a01..ff1b7aa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # 更新日志 -* (2020.03.10) 增加`LineChart`的普通折线图可通过设置`ingore`参数过滤数据的支持 +* (2020.03.10) 增加`LineChart`的普通折线图可通过`ignore`参数设置忽略数据的支持 * (2020.03.09) 增加`BarChart`可通过`ItemStyle`配置边框的支持 * (2020.03.08) 增加`RingChart`环形图 * (2020.03.05) 调整`Serie`的`arcShaped`参数重命名为`roundCap` diff --git a/Documentation/XCharts配置项手册.md b/Documentation/XCharts配置项手册.md index fac559b9..ee42387d 100644 --- a/Documentation/XCharts配置项手册.md +++ b/Documentation/XCharts配置项手册.md @@ -205,7 +205,7 @@ * `paddingTopBottom`:文字和边框的上下边距。 * `backgroundImage`:提示框的背景图。 * `forceENotation`:是否强制使用科学计数法格式化显示数值。默认为false,当小数精度大于3时才采用科学计数法。 -* `ingoreDataDefaultContent`:被忽略数据的默认显示字符信息。 +* `ignoreDataDefaultContent`:被忽略数据的默认显示字符信息。 * `lineStyle`:指示器线条样式 [LineStyle](#LineStyle)。 * `textStyle`:显示内容文本样式 [TextStyle](#TextStyle)。 @@ -466,8 +466,8 @@ * `Sum`:取过滤点之和。 * `sampleAverage`:设定的采样平均值。当 `sampleType` 为 `Peak` 时,用于和过滤数据的平均值做对比是取最大值还是最小值。默认为`0`时会实时计算所有数据的平均值。 * `clip`:是否裁剪超出坐标系部分的图形。 -* `ingore`:是否开启忽略数据。当为 `true` 时,数据值为 `ingoreValue` 时不进行绘制。 -* `ingoreValue`:忽略数据的默认值。当 `ingore` 为 `true` 才有效。 +* `ignore`:是否开启忽略数据。当为 `true` 时,数据值为 `ignoreValue` 时不进行绘制。 +* `ignoreValue`:忽略数据的默认值。当 `ignore` 为 `true` 才有效。 * `areaStyle`:区域填充样式 [AreaStyle](#AreaStyle)。 * `symbol`:标记的图形 [SerieSymbol](#SerieSymbol)。 * `lineType`:折线图样式类型。支持以下十种类型: diff --git a/Editor/PropertyDrawers/SerieDrawer.cs b/Editor/PropertyDrawers/SerieDrawer.cs index ada2a532..746d932c 100644 --- a/Editor/PropertyDrawers/SerieDrawer.cs +++ b/Editor/PropertyDrawers/SerieDrawer.cs @@ -71,8 +71,8 @@ namespace XCharts SerializedProperty m_GaugePointer = prop.FindPropertyRelative("m_GaugePointer"); SerializedProperty m_TitleStyle = prop.FindPropertyRelative("m_TitleStyle"); SerializedProperty m_Clip = prop.FindPropertyRelative("m_Clip"); - SerializedProperty m_Ingore = prop.FindPropertyRelative("m_Ingore"); - SerializedProperty m_IngoreValue = prop.FindPropertyRelative("m_IngoreValue"); + SerializedProperty m_Ignore = prop.FindPropertyRelative("m_Ignore"); + SerializedProperty m_IgnoreValue = prop.FindPropertyRelative("m_IgnoreValue"); SerializedProperty m_Datas = prop.FindPropertyRelative("m_Data"); int index = InitToggle(prop); @@ -124,9 +124,9 @@ namespace XCharts drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; EditorGUI.PropertyField(drawRect, m_Clip); drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; - EditorGUI.PropertyField(drawRect, m_Ingore); + EditorGUI.PropertyField(drawRect, m_Ignore); drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; - EditorGUI.PropertyField(drawRect, m_IngoreValue); + EditorGUI.PropertyField(drawRect, m_IgnoreValue); drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; EditorGUI.PropertyField(drawRect, m_Symbol); drawRect.y += EditorGUI.GetPropertyHeight(m_Symbol); diff --git a/Editor/PropertyDrawers/TooltipDrawer.cs b/Editor/PropertyDrawers/TooltipDrawer.cs index 9016040e..c3a7c47f 100644 --- a/Editor/PropertyDrawers/TooltipDrawer.cs +++ b/Editor/PropertyDrawers/TooltipDrawer.cs @@ -32,7 +32,7 @@ namespace XCharts SerializedProperty m_PaddingLeftRight = prop.FindPropertyRelative("m_PaddingLeftRight"); SerializedProperty m_PaddingTopBottom = prop.FindPropertyRelative("m_PaddingTopBottom"); SerializedProperty m_BackgroundImage = prop.FindPropertyRelative("m_BackgroundImage"); - SerializedProperty m_IngoreDataDefaultContent = prop.FindPropertyRelative("m_IngoreDataDefaultContent"); + SerializedProperty m_IgnoreDataDefaultContent = prop.FindPropertyRelative("m_IgnoreDataDefaultContent"); SerializedProperty m_LineStyle = prop.FindPropertyRelative("m_LineStyle"); SerializedProperty m_TextStyle = prop.FindPropertyRelative("m_TextStyle"); @@ -65,7 +65,7 @@ namespace XCharts drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; EditorGUI.PropertyField(drawRect, m_ForceENotation); drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; - EditorGUI.PropertyField(drawRect, m_IngoreDataDefaultContent); + EditorGUI.PropertyField(drawRect, m_IgnoreDataDefaultContent); drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; EditorGUI.PropertyField(drawRect, m_LineStyle); drawRect.y += EditorGUI.GetPropertyHeight(m_LineStyle); diff --git a/Runtime/Component/Main/Serie.cs b/Runtime/Component/Main/Serie.cs index d8971a86..7846c0cc 100644 --- a/Runtime/Component/Main/Serie.cs +++ b/Runtime/Component/Main/Serie.cs @@ -254,8 +254,8 @@ namespace XCharts [SerializeField] private bool m_ShowDataName; [SerializeField] private bool m_ShowDataIcon; [SerializeField] private bool m_Clip = true; - [SerializeField] private bool m_Ingore = true; - [SerializeField] private float m_IngoreValue = 0; + [SerializeField] private bool m_Ignore = false; + [SerializeField] private float m_IgnoreValue = 0; [SerializeField] private List m_Data = new List(); @@ -611,20 +611,20 @@ namespace XCharts set { if (PropertyUtility.SetStruct(ref m_RoundCap, value)) SetVerticesDirty(); } } /// - /// 是否开启忽略数据。当为 true 时,数据值为 ingoreValue 时不进行绘制。 + /// 是否开启忽略数据。当为 true 时,数据值为 ignoreValue 时不进行绘制。 /// - public bool ingore + public bool ignore { - get { return m_Ingore; } - set { if (PropertyUtility.SetStruct(ref m_Ingore, value)) SetVerticesDirty(); } + get { return m_Ignore; } + set { if (PropertyUtility.SetStruct(ref m_Ignore, value)) SetVerticesDirty(); } } /// - /// 忽略数据的默认值。当ingore为true才有效。 + /// 忽略数据的默认值。当ignore为true才有效。 /// - public float ingoreValue + public float ignoreValue { - get { return m_IngoreValue; } - set { if (PropertyUtility.SetStruct(ref m_IngoreValue, value)) SetVerticesDirty(); } + get { return m_IgnoreValue; } + set { if (PropertyUtility.SetStruct(ref m_IgnoreValue, value)) SetVerticesDirty(); } } /// /// 仪表盘轴线。 @@ -1558,7 +1558,7 @@ namespace XCharts public bool IsIngoreValue(float value) { - return m_Ingore && Mathf.Approximately(value, m_IngoreValue); + return m_Ignore && Mathf.Approximately(value, m_IgnoreValue); } /// diff --git a/Runtime/Component/Main/Tooltip.cs b/Runtime/Component/Main/Tooltip.cs index 2a004125..72600a0c 100644 --- a/Runtime/Component/Main/Tooltip.cs +++ b/Runtime/Component/Main/Tooltip.cs @@ -61,7 +61,7 @@ namespace XCharts [SerializeField] private bool m_ForceENotation = false; [SerializeField] private float m_PaddingLeftRight = 5f; [SerializeField] private float m_PaddingTopBottom = 5f; - [SerializeField] private string m_IngoreDataDefaultContent = "-"; + [SerializeField] private string m_IgnoreDataDefaultContent = "-"; [SerializeField] private Sprite m_BackgroundImage; [SerializeField] private TextStyle m_TextStyle = new TextStyle(18, FontStyle.Normal); [SerializeField] private LineStyle m_LineStyle = new LineStyle(LineStyle.Type.Solid, 0.7f); @@ -169,7 +169,7 @@ namespace XCharts /// /// 被忽略数据的默认显示字符信息。 /// - public string ingoreDataDefaultContent { get { return m_IngoreDataDefaultContent; } set { m_IngoreDataDefaultContent = value; } } + public string ignoreDataDefaultContent { get { return m_IgnoreDataDefaultContent; } set { m_IgnoreDataDefaultContent = value; } } /// /// The image of icon. /// 图标的图片。 diff --git a/Runtime/Internal/CoordinateChart.cs b/Runtime/Internal/CoordinateChart.cs index 4f04b782..aab7525d 100644 --- a/Runtime/Internal/CoordinateChart.cs +++ b/Runtime/Internal/CoordinateChart.cs @@ -434,7 +434,7 @@ namespace XCharts } else { - var valueTxt = isIngore ? m_Tooltip.ingoreDataDefaultContent : + var valueTxt = isIngore ? m_Tooltip.ignoreDataDefaultContent : ChartCached.FloatToStr(yValue, 0, m_Tooltip.forceENotation); sb.Append("\n") .Append("● ") diff --git a/Runtime/Utility/ChartHelper.cs b/Runtime/Utility/ChartHelper.cs index cc2fccb3..8700b7ac 100644 --- a/Runtime/Utility/ChartHelper.cs +++ b/Runtime/Utility/ChartHelper.cs @@ -24,7 +24,7 @@ namespace XCharts private static Vector3 s_DefaultIngoreDataVector3 = Vector3.zero; public static StringBuilder sb { get { return s_Builder; } } - public static Vector3 ingoreVector3 { get { return s_DefaultIngoreDataVector3; } } + public static Vector3 ignoreVector3 { get { return s_DefaultIngoreDataVector3; } } public static bool IsIngore(Vector3 pos) {