Hi
It could be nice if we could retrieve the index of an axis in the axis list.
A property like indexOf or GetIndex.
Same thing for a series in the sampledataseries list.
Also functions like SendtoBack, BringtoFront, MoveUp, MoveDown could be nice to move an axis or a series in the list.
thanks
axis index and series index
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: axis index and series index
The List collection properties have these:
Axis index:
int axisIndex = chart.ViewXY.XAxes.IndexOf(axisX);
Series index:
int seriesIndex = chart.ViewXY.SampleDataSeries.IndexOf(series);
The order of series or axes list tell the rendering order. Change the list order.
Moving list item one step earlier:
AxisX moveThis = chart.ViewXY.XAxes[5];
chart.ViewXY.XAxes.RemoveAt(5);
chart.ViewXY.XAxes.Insert(4, moveThis);
That should work.
Axis index:
int axisIndex = chart.ViewXY.XAxes.IndexOf(axisX);
Series index:
int seriesIndex = chart.ViewXY.SampleDataSeries.IndexOf(series);
The order of series or axes list tell the rendering order. Change the list order.
Moving list item one step earlier:
AxisX moveThis = chart.ViewXY.XAxes[5];
chart.ViewXY.XAxes.RemoveAt(5);
chart.ViewXY.XAxes.Insert(4, moveThis);
That should work.
LightningChart Support Team, PT
Re: axis index and series index
if I remove and insert the axis the series doesn't follow the axis
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: axis index and series index
True, it doesn't because it has AssignXAxisIndex or AssignYAxisIndex defined and now that index refers to different axis after moving the axis in the list.
Set these properties to match the new axis index.
Set these properties to match the new axis index.
LightningChart Support Team, PT