diff --git a/Assets/XCharts/CHANGELOG-EN.md b/Assets/XCharts/CHANGELOG-EN.md index 839febf5..3011fa25 100644 --- a/Assets/XCharts/CHANGELOG-EN.md +++ b/Assets/XCharts/CHANGELOG-EN.md @@ -1,6 +1,8 @@ # 更新日志 +* (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 * (2020.11.12) Fixed `LineChart` reporting errors when the type was `Smooth` when the data was too secure #100 * (2020.10.22) Improve the support of `VisualMap` for `Piecewise` in `HeatmapChart` diff --git a/Assets/XCharts/CHANGELOG.md b/Assets/XCharts/CHANGELOG.md index a05247c8..96492c72 100644 --- a/Assets/XCharts/CHANGELOG.md +++ b/Assets/XCharts/CHANGELOG.md @@ -1,6 +1,8 @@ # 更新日志 +* (2020.11.21) 修复`LineChart`的刻度位置在`alignWithLabel`为`true`时可能异常的问题 +* (2020.11.21) 修复`Unity5`兼容报错的问题 * (2020.11.13) 完善`RadarChart`的`Indicator`对`\n`换行的支持 * (2020.11.12) 修复`LineChart`当类型为`Smooth`时数据过密情况下报错的问题 #100 * (2020.10.22) 完善`HeatmapChart`中`VisualMap`对`Piecewise`的支持 diff --git a/Assets/XCharts/Runtime/Internal/Helper/AxisHelper.cs b/Assets/XCharts/Runtime/Internal/Helper/AxisHelper.cs index 5b9fbdf3..ee560d0e 100644 --- a/Assets/XCharts/Runtime/Internal/Helper/AxisHelper.cs +++ b/Assets/XCharts/Runtime/Internal/Helper/AxisHelper.cs @@ -214,7 +214,11 @@ namespace XCharts var count = axis.boundaryGap ? axis.data.Count : axis.data.Count - 1; if (count <= 0) return 0; var each = coordinateWidth / count; - if (index >= num - 1) return coordinateWidth - each * tick * (index - 1); + if (index >= num - 1) + { + if (axis.axisTick.alignWithLabel) return each * tick; + else return coordinateWidth - each * tick * (index - 1); + } else return each * tick; } else