增加PieRadargridIndex支持设置指定网格

This commit is contained in:
monitor1394
2023-08-29 22:20:29 +08:00
parent e4fbe5670f
commit 8df1dbe0fb
17 changed files with 164 additions and 63 deletions

View File

@@ -478,7 +478,7 @@ namespace XCharts.Runtime
set { if (PropertyUtil.SetStruct(ref m_ParallelIndex, value)) SetAllDirty(); }
}
/// <summary>
/// Index of layout component that serie uses.
/// Index of layout component that serie uses. Default is -1 means not use layout, otherwise use the first layout component.
/// |所使用的 layout 组件的 index。 默认为-1不指定index, 当为大于或等于0时, 为第一个layout组件的第index个格子。
/// </summary>
public int gridIndex

View File

@@ -221,12 +221,10 @@ namespace XCharts.Runtime
var chartHeight = chart.chartHeight;
if (serie.gridIndex >= 0)
{
var grid = chart.GetChartComponent<GridCoord>(serie.gridIndex);
if (grid != null)
var layout = chart.GetChartComponent<GridLayout>(0);
if (layout != null)
{
chartPosition = grid.context.position;
chartWidth = grid.context.width;
chartHeight = grid.context.height;
layout.UpdateGridContext(serie.gridIndex, ref chartPosition, ref chartWidth, ref chartHeight);
}
}
var centerX = serie.center[0] <= 1 ? chartWidth * serie.center[0] : serie.center[0];