优化DataZoom

This commit is contained in:
monitor1394
2021-05-22 15:29:55 +08:00
parent 1b72bdf0ab
commit 355d3639b1
8 changed files with 98 additions and 10 deletions

View File

@@ -1737,8 +1737,17 @@ namespace XCharts
public Grid GetDataZoomGridOrDefault(DataZoom dataZoom)
{
var xAxis = GetXAxis(dataZoom.xAxisIndexs[0]);
Grid grid = GetGrid(xAxis.gridIndex);
Grid grid = null;
if (dataZoom.xAxisIndexs != null && dataZoom.xAxisIndexs.Count > 0)
{
var xAxis = GetXAxis(dataZoom.xAxisIndexs[0]);
grid = GetGrid(xAxis.gridIndex);
}
else if (dataZoom.yAxisIndexs != null && dataZoom.yAxisIndexs.Count > 0)
{
var yAxis = GetYAxis(dataZoom.yAxisIndexs[0]);
grid = GetGrid(yAxis.gridIndex);
}
if (grid == null) return m_Grids[0];
else return grid;
}