SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
Hi,
How can i get to first and last items indexes on visible range when onVisibleRangeChanged triggered?
Tnx.
Hi Dunya,
It depends on what type of XAxis do you use:
If it’s value axis (e.g. NumericAxis or DateAxis) then you need to search for the closest value – for Min/Max values of VisibleRange find index in target DataSeries:
int minIndex = dataSeries.getXValues().findIndex(min, SearchMode.Nearest);
int maxIndex = dataSeries.getXValues().findIndex(max, SearchMode.Nearest);
Also you can get xIndexRange from RenderableSeries’s CurrentRenderPassData which contains range of data points which are within chart’s viewport and should be rendered by RenderableSeries:
final IndexRange xPointRange = ((SeriesRenderPassData) rSeries.getCurrentRenderPassData()).xPointRange;
Hope this will help you!
Best regards,
Yura
Please login first to submit.