Skip to content

Commit

Permalink
修复LineChart的刻度位置在alignWithLabeltrue时可能异常的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
monitor1394 committed Nov 21, 2020
1 parent 30f40b6 commit a428128
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Assets/XCharts/CHANGELOG-EN.md
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
2 changes: 2 additions & 0 deletions Assets/XCharts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`的支持
Expand Down
6 changes: 5 additions & 1 deletion Assets/XCharts/Runtime/Internal/Helper/AxisHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@ internal static float GetScaleWidth(Axis axis, float coordinateWidth, int index,
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
Expand Down

0 comments on commit a428128

Please sign in to comment.