diff --git a/Editor/BaseChartEditor.cs b/Editor/BaseChartEditor.cs index 78c331f8..775e9c8e 100644 --- a/Editor/BaseChartEditor.cs +++ b/Editor/BaseChartEditor.cs @@ -209,14 +209,12 @@ namespace XCharts if (m_Flodouts[prop.displayName]) { EditorGUI.indentLevel++; - //prop.arraySize = EditorGUILayout.IntField("Size", prop.arraySize); var currRect = EditorGUILayout.GetControlRect(GUILayout.Height(0)); currRect.y -= EditorGUIUtility.singleLineHeight; var rect1 = new Rect(currRect.width + k_IconXOffset, currRect.y + k_IconYOffset, k_IconWidth, EditorGUIUtility.singleLineHeight); - EditorGUI.DrawRect(rect1, Color.blue); - if (GUI.Button(rect1, ChartEditorHelper.Styles.iconAdd))// ChartEditorHelper.Styles.invisibleButton)) + if (GUI.Button(rect1, ChartEditorHelper.Styles.iconAdd, ChartEditorHelper.Styles.invisibleButton)) { prop.InsertArrayElementAtIndex(prop.arraySize > 0 ? prop.arraySize - 1 : 0); var chart = prop.GetArrayElementAtIndex(0).serializedObject.targetObject as BaseChart; diff --git a/Runtime/Component/Main/Tooltip.cs b/Runtime/Component/Main/Tooltip.cs index 14e57ccc..de0c02b3 100644 --- a/Runtime/Component/Main/Tooltip.cs +++ b/Runtime/Component/Main/Tooltip.cs @@ -471,6 +471,7 @@ namespace XCharts /// public bool IsDataIndexChanged() { + if (runtimeDataIndex.Count < 2 || lastDataIndex.Count < 2) return false; return runtimeDataIndex[0] != lastDataIndex[0] || runtimeDataIndex[1] != lastDataIndex[1]; } diff --git a/Runtime/Helper/SeriesHelper.cs b/Runtime/Helper/SeriesHelper.cs index 9e698a2e..e729e122 100644 --- a/Runtime/Helper/SeriesHelper.cs +++ b/Runtime/Helper/SeriesHelper.cs @@ -277,7 +277,7 @@ namespace XCharts int count = 0; foreach (var serie in series.list) { - if (serie.show && serie.type == type) + if (serie.show && (serie.type == type || serie.type == SerieType.Custom)) { if (stackName.Equals(serie.stack)) count++; if (count >= 2) return true; diff --git a/Runtime/Internal/CoordinateChart_DrawBar.cs b/Runtime/Internal/CoordinateChart_DrawBar.cs index 680efc25..1250f23b 100644 --- a/Runtime/Internal/CoordinateChart_DrawBar.cs +++ b/Runtime/Internal/CoordinateChart_DrawBar.cs @@ -583,7 +583,7 @@ namespace XCharts public float Internal_GetBarGap() { - float gap = 0.3f; + float gap = 0f; for (int i = 0; i < m_Series.Count; i++) { var serie = m_Series.list[i]; @@ -675,7 +675,7 @@ namespace XCharts for (int i = 0; i < m_Series.Count; i++) { var serie = m_Series.GetSerie(i); - if (serie.type != SerieType.Bar || serie.type == SerieType.Custom) continue; + if (serie.type != SerieType.Bar && serie.type != SerieType.Custom) continue; if (string.IsNullOrEmpty(serie.stack)) { if (serie.index == currSerie.index) return index; diff --git a/Runtime/Internal/Utility/ChartHelper.cs b/Runtime/Internal/Utility/ChartHelper.cs index 8e8e8e0d..f7d43b79 100644 --- a/Runtime/Internal/Utility/ChartHelper.cs +++ b/Runtime/Internal/Utility/ChartHelper.cs @@ -1005,10 +1005,9 @@ namespace XCharts } } - public static Color32 GetHighlightColor(Color32 color) + public static Color32 GetHighlightColor(Color32 color, float rate = 0.8f) { var newColor = color; - var rate = 0.8f; newColor.r = (byte)(color.r * rate); newColor.g = (byte)(color.g * rate); newColor.b = (byte)(color.b * rate);