* UILineChart: 显示点的颜色支持自定义

This commit is contained in:
Sunny 2021-10-03 10:39:01 +08:00
parent 39a8472c85
commit cd56ac542e
5 changed files with 5 additions and 3 deletions

Binary file not shown.

Binary file not shown.

View File

@ -48,7 +48,6 @@ namespace Sunny.UI.Demo
series.Symbol = UILinePointSymbol.Star; series.Symbol = UILinePointSymbol.Star;
series.SymbolSize = 4; series.SymbolSize = 4;
series.SymbolLineWidth = 2; series.SymbolLineWidth = 2;
series.SymbolColor = Color.Red;
series.Smooth = true; series.Smooth = true;
series.ShowLine = !cbPoints.Checked; series.ShowLine = !cbPoints.Checked;

View File

@ -22,6 +22,7 @@
* 2021-06-18: V3.0.4 * 2021-06-18: V3.0.4
* 2021-07-22: V3.0.5 Demo * 2021-07-22: V3.0.5 Demo
* 2021-08-23: V3.0.6 * 2021-08-23: V3.0.6
* 2021-10-02: V3.0.8 Nan
******************************************************************************/ ******************************************************************************/
using System; using System;
@ -450,7 +451,7 @@ namespace Sunny.UI
foreach (var series in Option.Series.Values) foreach (var series in Option.Series.Values)
{ {
Color color = series.Color; Color color = series.Color;
if (!series.CustomColor) color = ChartStyle.GetColor(idx); if (series.SymbolColor.IsValid()) color = series.SymbolColor;
if (series.Symbol != UILinePointSymbol.None) if (series.Symbol != UILinePointSymbol.None)
{ {

View File

@ -280,7 +280,7 @@ namespace Sunny.UI
public int SymbolLineWidth { get; set; } = 1; public int SymbolLineWidth { get; set; } = 1;
public Color SymbolColor { get; set; } public Color SymbolColor { get; set; } = Color.Empty;
public bool CustomColor { get; set; } public bool CustomColor { get; set; }
@ -355,6 +355,8 @@ namespace Sunny.UI
public void Clear() public void Clear()
{ {
ContainsNan = false; ContainsNan = false;
SymbolColor = Color.Empty;
XData.Clear(); XData.Clear();
YData.Clear(); YData.Clear();
ClearPoints(); ClearPoints();