修复LineChart的刻度位置在alignWithLabeltrue时可能异常的问题

This commit is contained in:
monitor1394
2020-11-21 08:42:03 +08:00
parent 30f40b601f
commit a4281288ee
3 changed files with 9 additions and 1 deletions

View File

@@ -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`

View File

@@ -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`的支持

View File

@@ -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