From d581637b993de4e8baa401b5e1d11197fbd8bdec Mon Sep 17 00:00:00 2001 From: Sunny Date: Tue, 19 Apr 2022 22:38:05 +0800 Subject: [PATCH] =?UTF-8?q?*=20UILineChart:=20=E5=85=B3=E9=97=ADSmooth?= =?UTF-8?q?=E7=BB=98=E5=88=B6=EF=BC=8C=E6=95=B0=E5=80=BC=E5=B7=AE=E8=B7=9D?= =?UTF-8?q?=E5=A4=A7=E6=88=96=E8=80=85=E6=8C=81=E7=BB=AD=E7=BC=A9=E6=94=BE?= =?UTF-8?q?=E4=BC=9A=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Charts/UILineChart.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/SunnyUI/Charts/UILineChart.cs b/SunnyUI/Charts/UILineChart.cs index 4b08645d..a86b2666 100644 --- a/SunnyUI/Charts/UILineChart.cs +++ b/SunnyUI/Charts/UILineChart.cs @@ -31,6 +31,7 @@ * 2022-01-06: V3.1.0 支持FillColor透明 * 2022-01-09: V3.1.0 双坐标轴支持选区域缩放 * 2022-02-09: V3.1.0 增加图线隐藏 + * 2022-04-19: V3.1.5 关闭Smooth绘制,数值差距大或者持续缩放会出错 ******************************************************************************/ using System; @@ -452,17 +453,17 @@ namespace Sunny.UI using (Pen pen = new Pen(color, series.Width)) { g.SetHighQuality(); - if (series.ContainsNan || !series.Smooth) + //if (series.ContainsNan || !series.Smooth) + //{ + for (int i = 0; i < series.Points.Count - 1; i++) { - for (int i = 0; i < series.Points.Count - 1; i++) - { - g.DrawTwoPoints(pen, series.Points[i], series.Points[i + 1], DrawRect); - } - } - else - { - g.DrawCurve(pen, series.Points.ToArray()); + g.DrawTwoPoints(pen, series.Points[i], series.Points[i + 1], DrawRect); } + //} + //else + //{ + // g.DrawCurve(pen, series.Points.ToArray()); + //} g.SetDefaultQuality(); }