From c2ee18fa6d2cb893ab315d9ae6cde39ef4255c19 Mon Sep 17 00:00:00 2001 From: Sunny Date: Tue, 26 Jul 2022 13:44:52 +0800 Subject: [PATCH] =?UTF-8?q?*=20UILineChart:=20=E4=BF=AE=E5=A4=8D=E5=8F=8CY?= =?UTF-8?q?=E8=BD=B4=E6=95=B0=E6=8D=AE=E7=82=B9=E6=8F=90=E7=A4=BA=E6=96=87?= =?UTF-8?q?=E5=AD=97=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Charts/UILineChart.cs | 9 +++++++-- SunnyUI/Charts/UILineChartOption.cs | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/SunnyUI/Charts/UILineChart.cs b/SunnyUI/Charts/UILineChart.cs index e68d27f3..3d8b0d12 100644 --- a/SunnyUI/Charts/UILineChart.cs +++ b/SunnyUI/Charts/UILineChart.cs @@ -33,6 +33,7 @@ * 2022-02-09: V3.1.0 增加图线隐藏 * 2022-04-19: V3.1.5 关闭Smooth绘制,数值差距大或者持续缩放会出错 * 2022-07-11: V3.2.1 修改两个点时可以不显示连接线 + * 2022-07-26: V3.2.2 修复双Y轴数据点提示文字显示 ******************************************************************************/ using System; @@ -809,6 +810,7 @@ namespace Sunny.UI point.X = x; point.Y = y; point.Location = new Point((int)series.Points[index].X, (int)series.Points[index].Y); + point.IsY2 = series.IsY2; selectPointsTemp.Add(point); } } @@ -858,8 +860,11 @@ namespace Sunny.UI else sb.Append(point.X.ToString("F" + Option.XAxis.AxisLabel.DecimalCount)); sb.Append('\n'); - sb.Append( - Option.YAxis.Name + ": " + point.Y.ToString("F" + Option.YAxis.AxisLabel.DecimalCount)); + + if (point.IsY2) + sb.Append(Option.Y2Axis.Name + ": " + point.Y.ToString("F" + Option.Y2Axis.AxisLabel.DecimalCount)); + else + sb.Append(Option.YAxis.Name + ": " + point.Y.ToString("F" + Option.YAxis.AxisLabel.DecimalCount)); idx++; } diff --git a/SunnyUI/Charts/UILineChartOption.cs b/SunnyUI/Charts/UILineChartOption.cs index eb3fdea6..66a78333 100644 --- a/SunnyUI/Charts/UILineChartOption.cs +++ b/SunnyUI/Charts/UILineChartOption.cs @@ -493,6 +493,8 @@ namespace Sunny.UI public double Y { get; set; } public Point Location { get; set; } + + public bool IsY2 { get; set; } } public class UILineWarningArea