Fixed bug where AxisLabel displayed incorrectly with DataRoom (#138)

This commit is contained in:
monitor1394
2021-04-28 07:00:23 +08:00
parent 6291fd27b0
commit 3c58396c1f
3 changed files with 5 additions and 3 deletions

View File

@@ -34,6 +34,7 @@
## Latest
* (2021.04.28) Fixed bug where `AxisLabel` displayed incorrectly with `DataRoom` (#138)
* (2021.04.26) Fixed dynamically creating chart at runtime would be abnormal #137
* (2021.04.26) Added support for `Barchart` to draw gradient borders
* (2021.04.23) Added support for custom charts

View File

@@ -34,6 +34,7 @@
## Latest
* (2021.04.28) 修复`DataZoom``AxisLabel`显示不准确的问题 #138
* (2021.04.26) 修复运行时动态创建图表会异常的问题 #137
* (2021.04.26) 增加`BarChart`绘制渐变边框的支持
* (2021.04.23) 增加自定义图表支持

View File

@@ -213,7 +213,7 @@ namespace XCharts
int splitNum = GetSplitNumber(axis, coordinateWidth, dataZoom);
if (axis.IsCategory())
{
var data = axis.GetDataList();
var data = axis.GetDataList(dataZoom);
int tick = Mathf.RoundToInt(data.Count * 1f / splitNum);
if (axis.boundaryGap)
return Mathf.CeilToInt(data.Count * 1.0f / tick) + 1;
@@ -246,7 +246,7 @@ namespace XCharts
}
else
{
var data = axis.GetDataList();
var data = axis.GetDataList(dataZoom);
if (axis.IsCategory() && data.Count > 0)
{
int tick = Mathf.RoundToInt(data.Count * 1f / splitNum);
@@ -270,7 +270,7 @@ namespace XCharts
public static float GetEachWidth(Axis axis, float coordinateWidth, DataZoom dataZoom = null)
{
var data = axis.GetDataList();
var data = axis.GetDataList(dataZoom);
if (data.Count > 0)
{
var count = axis.boundaryGap ? data.Count : data.Count - 1;