mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-26 19:00:24 +00:00
增加Pie和Radar的gridIndex支持设置指定网格
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user