From 105d0a85f96a5502bc4335fbc337571f15671592 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Sun, 22 Nov 2020 15:10:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`LineChart`=E5=9C=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=87=E4=BA=8E=E5=AF=86=E9=9B=86=E6=97=B6=E6=8A=98?= =?UTF-8?q?=E7=BA=BF=E7=BB=98=E5=88=B6=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20#99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/XCharts/CHANGELOG-EN.md | 1 + Assets/XCharts/CHANGELOG.md | 1 + .../Runtime/Internal/CoordinateChart_DrawLine.cs | 11 +++++++++++ 3 files changed, 13 insertions(+) diff --git a/Assets/XCharts/CHANGELOG-EN.md b/Assets/XCharts/CHANGELOG-EN.md index 3011fa25..6846e505 100644 --- a/Assets/XCharts/CHANGELOG-EN.md +++ b/Assets/XCharts/CHANGELOG-EN.md @@ -1,6 +1,7 @@ # 更新日志 +* (2020.11.22) Fixed an issue where `LineChart` draws an exception when the data is too dense #99 * (2020.11.21) Fixed an issue where the scale position of `LineChart` could be abnormal if `alignWithLabel` was `true` * (2020.11.21) Fixed `Unity5` compatibility error reporting problem * (2020.11.13) Improved `RadarChart` `Indicator` support for `\n` line feed diff --git a/Assets/XCharts/CHANGELOG.md b/Assets/XCharts/CHANGELOG.md index 96492c72..f4feebdb 100644 --- a/Assets/XCharts/CHANGELOG.md +++ b/Assets/XCharts/CHANGELOG.md @@ -1,6 +1,7 @@ # 更新日志 +* (2020.11.22) 修复`LineChart`在数据过于密集时折线绘制异常的问题 #99 * (2020.11.21) 修复`LineChart`的刻度位置在`alignWithLabel`为`true`时可能异常的问题 * (2020.11.21) 修复`Unity5`兼容报错的问题 * (2020.11.13) 完善`RadarChart`的`Indicator`对`\n`换行的支持 diff --git a/Assets/XCharts/Runtime/Internal/CoordinateChart_DrawLine.cs b/Assets/XCharts/Runtime/Internal/CoordinateChart_DrawLine.cs index 846ec0da..064a0edb 100644 --- a/Assets/XCharts/Runtime/Internal/CoordinateChart_DrawLine.cs +++ b/Assets/XCharts/Runtime/Internal/CoordinateChart_DrawLine.cs @@ -674,6 +674,16 @@ private bool DrawNormalLine(VertexHelper vh, Serie serie, Axis axis, Vector3 lp, upPos1 = np + (isDown ? -dir1v : dir1v) * serie.lineStyle.width; upPos2 = np + (isDown ? -dir2v : dir2v) * serie.lineStyle.width; lastDir = dir1; + if (isDown) + { + if (isYAxis && dnPos.x < lp.x && dnPos.x < nnp.x) dnPos.x = lp.x; + if (!isYAxis && dnPos.y < lp.y && dnPos.y < nnp.y) dnPos.y = lp.y; + } + else + { + if (isYAxis && dnPos.x > lp.x && dnPos.x > nnp.x) dnPos.x = lp.x; + if (!isYAxis && dnPos.y > lp.y && dnPos.y > nnp.y) dnPos.y = lp.y; + } } else { @@ -683,6 +693,7 @@ private bool DrawNormalLine(VertexHelper vh, Serie serie, Axis axis, Vector3 lp, upPos1 = np - dir1v * serie.lineStyle.width; upPos2 = np + dir1v * serie.lineStyle.width; dnPos = isDown ? upPos2 : upPos1; + } if (isSecond) {