diff --git a/Bin/net40/SunnyUI.Demo.exe b/Bin/net40/SunnyUI.Demo.exe index c0f10d6f..0de759c9 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 fa1171f7..27de98d2 100644 Binary files a/Bin/net40/SunnyUI.dll and b/Bin/net40/SunnyUI.dll differ diff --git a/Bin/net462/SunnyUI.dll b/Bin/net462/SunnyUI.dll index 0e52e555..761daf19 100644 Binary files a/Bin/net462/SunnyUI.dll and b/Bin/net462/SunnyUI.dll differ diff --git a/Bin/net5.0-windows/SunnyUI.dll b/Bin/net5.0-windows/SunnyUI.dll index 8f1c142b..44940a26 100644 Binary files a/Bin/net5.0-windows/SunnyUI.dll and b/Bin/net5.0-windows/SunnyUI.dll differ diff --git a/Bin/net5.0-windows/ref/SunnyUI.dll b/Bin/net5.0-windows/ref/SunnyUI.dll index f3c754f3..29b4d915 100644 Binary files a/Bin/net5.0-windows/ref/SunnyUI.dll and b/Bin/net5.0-windows/ref/SunnyUI.dll differ diff --git a/Bin/netcoreapp3.1/SunnyUI.dll b/Bin/netcoreapp3.1/SunnyUI.dll index 2547d2ef..523e94cd 100644 Binary files a/Bin/netcoreapp3.1/SunnyUI.dll and b/Bin/netcoreapp3.1/SunnyUI.dll differ diff --git a/SunnyUI.Demo/Charts/FLineChart.Designer.cs b/SunnyUI.Demo/Charts/FLineChart.Designer.cs index 0fd5304b..d954ed63 100644 --- a/SunnyUI.Demo/Charts/FLineChart.Designer.cs +++ b/SunnyUI.Demo/Charts/FLineChart.Designer.cs @@ -36,6 +36,7 @@ this.LineChart = new Sunny.UI.UILineChart(); this.uiSymbolButton2 = new Sunny.UI.UISymbolButton(); this.timer1 = new System.Windows.Forms.Timer(this.components); + this.uiCheckBox1 = new Sunny.UI.UICheckBox(); ((System.ComponentModel.ISupportInitialize)(this.uiImageButton3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.uiImageButton2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.uiImageButton1)).BeginInit(); @@ -128,11 +129,25 @@ // this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // + // uiCheckBox1 + // + this.uiCheckBox1.Cursor = System.Windows.Forms.Cursors.Hand; + this.uiCheckBox1.Font = new System.Drawing.Font("微软雅黑", 12F); + this.uiCheckBox1.Location = new System.Drawing.Point(571, 505); + this.uiCheckBox1.MinimumSize = new System.Drawing.Size(1, 1); + this.uiCheckBox1.Name = "uiCheckBox1"; + this.uiCheckBox1.Padding = new System.Windows.Forms.Padding(22, 0, 0, 0); + this.uiCheckBox1.Size = new System.Drawing.Size(100, 29); + this.uiCheckBox1.TabIndex = 37; + this.uiCheckBox1.Text = "显示点"; + this.uiCheckBox1.CheckedChanged += new System.EventHandler(this.uiCheckBox1_CheckedChanged); + // // FLineChart // this.AllowShowTitle = true; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.ClientSize = new System.Drawing.Size(800, 574); + this.Controls.Add(this.uiCheckBox1); this.Controls.Add(this.uiSymbolButton2); this.Controls.Add(this.uiSymbolButton1); this.Controls.Add(this.uiImageButton3); @@ -160,5 +175,6 @@ private UILineChart LineChart; private UISymbolButton uiSymbolButton2; private System.Windows.Forms.Timer timer1; + private UICheckBox uiCheckBox1; } } \ No newline at end of file diff --git a/SunnyUI.Demo/Charts/FLineChart.cs b/SunnyUI.Demo/Charts/FLineChart.cs index 5e893f85..c644651f 100644 --- a/SunnyUI.Demo/Charts/FLineChart.cs +++ b/SunnyUI.Demo/Charts/FLineChart.cs @@ -132,5 +132,17 @@ namespace Sunny.UI.Demo.Charts LineChart.Refresh(); } + + private void uiCheckBox1_CheckedChanged(object sender, EventArgs e) + { + if (LineChart.Option == null) return; + foreach (var series in LineChart.Option.Series.Values) + { + series.ShowLine = !uiCheckBox1.Checked; + series.Symbol = uiCheckBox1.Checked ? UILinePointSymbol.Circle : UILinePointSymbol.None; + } + + LineChart.Refresh(); + } } } diff --git a/SunnyUI/Charts/UILineChart.cs b/SunnyUI/Charts/UILineChart.cs index e9c5e5e9..7abab2ba 100644 --- a/SunnyUI/Charts/UILineChart.cs +++ b/SunnyUI/Charts/UILineChart.cs @@ -21,6 +21,7 @@ * 2021-04-15: V3.0.3 有右键菜单时,取消恢复上次缩放,可在右键菜单增加节点,调用ZoomBack()方法 * 2021-06-18: V3.0.4 显示鼠标点格式更新 * 2021-07-22: V3.0.5 可自定义背景色,增加实时数据的Demo + * 2021-08-23: V3.0.6 增加可只显示点的模式 ******************************************************************************/ using System; @@ -306,14 +307,17 @@ namespace Sunny.UI return; } - using (Pen pen = new Pen(color, series.Width)) + if (series.ShowLine || series.Symbol == UILinePointSymbol.None) { - g.SetHighQuality(); - if (series.Smooth) - g.DrawCurve(pen, series.Points.ToArray()); - else - g.DrawLines(pen, series.Points.ToArray()); - g.SetDefaultQuality(); + using (Pen pen = new Pen(color, series.Width)) + { + g.SetHighQuality(); + if (series.Smooth) + g.DrawCurve(pen, series.Points.ToArray()); + else + g.DrawLines(pen, series.Points.ToArray()); + g.SetDefaultQuality(); + } } } diff --git a/SunnyUI/Charts/UILineChartOption.cs b/SunnyUI/Charts/UILineChartOption.cs index 28a65889..c55c1c9a 100644 --- a/SunnyUI/Charts/UILineChartOption.cs +++ b/SunnyUI/Charts/UILineChartOption.cs @@ -261,6 +261,8 @@ namespace Sunny.UI public bool Smooth { get; set; } + public bool ShowLine { get; set; } = true; + public UILineSeries(string name) { Name = name;