diff --git a/Bin/net40/SunnyUI.Demo.exe b/Bin/net40/SunnyUI.Demo.exe index 160c6d17..275d931b 100644 Binary files a/Bin/net40/SunnyUI.Demo.exe and b/Bin/net40/SunnyUI.Demo.exe differ diff --git a/Bin/net40/SunnyUI.dll b/Bin/net40/SunnyUI.dll index 38895f99..a92d3a35 100644 Binary files a/Bin/net40/SunnyUI.dll and b/Bin/net40/SunnyUI.dll differ diff --git a/SunnyUI.Demo/Charts/FLineChart.cs b/SunnyUI.Demo/Charts/FLineChart.cs index cb48acfd..16049f40 100644 --- a/SunnyUI.Demo/Charts/FLineChart.cs +++ b/SunnyUI.Demo/Charts/FLineChart.cs @@ -48,7 +48,6 @@ namespace Sunny.UI.Demo series.Symbol = UILinePointSymbol.Star; series.SymbolSize = 4; series.SymbolLineWidth = 2; - series.SymbolColor = Color.Red; series.Smooth = true; series.ShowLine = !cbPoints.Checked; diff --git a/SunnyUI/Charts/UILineChart.cs b/SunnyUI/Charts/UILineChart.cs index 9f0ce29b..4b01ea1d 100644 --- a/SunnyUI/Charts/UILineChart.cs +++ b/SunnyUI/Charts/UILineChart.cs @@ -22,6 +22,7 @@ * 2021-06-18: V3.0.4 显示鼠标点格式更新 * 2021-07-22: V3.0.5 可自定义背景色,增加实时数据的Demo * 2021-08-23: V3.0.6 增加可只显示点的模式 + * 2021-10-02: V3.0.8 支持数据包括Nan ******************************************************************************/ using System; @@ -450,7 +451,7 @@ namespace Sunny.UI foreach (var series in Option.Series.Values) { Color color = series.Color; - if (!series.CustomColor) color = ChartStyle.GetColor(idx); + if (series.SymbolColor.IsValid()) color = series.SymbolColor; if (series.Symbol != UILinePointSymbol.None) { diff --git a/SunnyUI/Charts/UILineChartOption.cs b/SunnyUI/Charts/UILineChartOption.cs index 66f767fb..130c0867 100644 --- a/SunnyUI/Charts/UILineChartOption.cs +++ b/SunnyUI/Charts/UILineChartOption.cs @@ -280,7 +280,7 @@ namespace Sunny.UI public int SymbolLineWidth { get; set; } = 1; - public Color SymbolColor { get; set; } + public Color SymbolColor { get; set; } = Color.Empty; public bool CustomColor { get; set; } @@ -355,6 +355,8 @@ namespace Sunny.UI public void Clear() { ContainsNan = false; + SymbolColor = Color.Empty; + XData.Clear(); YData.Clear(); ClearPoints();