Skip to content

Commit

Permalink
修复LineChart在数据过于密集时折线绘制异常的问题 #99
Browse files Browse the repository at this point in the history
  • Loading branch information
monitor1394 committed Nov 22, 2020
1 parent a428128 commit 105d0a8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions Assets/XCharts/CHANGELOG-EN.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions Assets/XCharts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`换行的支持
Expand Down
11 changes: 11 additions & 0 deletions Assets/XCharts/Runtime/Internal/CoordinateChart_DrawLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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)
{
Expand Down

0 comments on commit 105d0a8

Please sign in to comment.