Skip to content

Commit

Permalink
修复DataZoom控制多个轴时的GridCoord获取可能不正确的问题 (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
monitor1394 committed Apr 22, 2024
1 parent 120c6d5 commit b1522a2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions Documentation~/zh/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ slug: /changelog

## master

* (2024.04.22) 修复`DataZoom`控制多个轴时的`GridCoord`获取可能不正确的问题 (#317)
* (2024.04.22) 增加`GridCoord3D`3D坐标系
* (2024.04.15) 优化`DateTimeUtil`时间戳转`DateTime`接口时区的问题
* (2024.04.15) 优化`GridCoord`在开启`GridLayout`时也显示`Left` `Right` `Top` `Bottom`参数 (#316)
Expand Down
24 changes: 20 additions & 4 deletions Runtime/Internal/BaseChart.Component.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,29 @@ public GridCoord GetGridOfDataZoom(DataZoom dataZoom)
GridCoord grid = null;
if (dataZoom.xAxisIndexs != null && dataZoom.xAxisIndexs.Count > 0)
{
var xAxis = GetChartComponent<XAxis>(dataZoom.xAxisIndexs[0]);
grid = GetChartComponent<GridCoord>(xAxis.gridIndex);
for (int i = 0; i < dataZoom.xAxisIndexs.Count; i++)
{
var xAxis = GetChartComponent<XAxis>(dataZoom.xAxisIndexs[i]);
var tempGrid = GetChartComponent<GridCoord>(xAxis.gridIndex);
if (tempGrid.IsPointerEnter())
{
grid = tempGrid;
break;
}
}
}
else if (dataZoom.yAxisIndexs != null && dataZoom.yAxisIndexs.Count > 0)
{
var yAxis = GetChartComponent<YAxis>(dataZoom.yAxisIndexs[0]);
grid = GetChartComponent<GridCoord>(yAxis.gridIndex);
for (int i = 0; i < dataZoom.yAxisIndexs.Count; i++)
{
var yAxis = GetChartComponent<YAxis>(dataZoom.yAxisIndexs[i]);
var tempGrid = GetChartComponent<GridCoord>(yAxis.gridIndex);
if (tempGrid.IsPointerEnter())
{
grid = tempGrid;
break;
}
}
}
if (grid == null) return GetChartComponent<GridCoord>();
else return grid;
Expand Down

0 comments on commit b1522a2

Please sign in to comment.