SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!
I’m revisiting a problem I asked about here a year ago. My goal was to create a chart where the visible range is scrolling “window” that advances ahead of the most recent data point when the data hits the edge so that the line is always moving from the center of the chart towards the edge.
I was able to get something to work by inheriting from the NumericAxis type and overriding CalculateDataRange(). I’m trying this again with a more recent version of SciChart (4.2.2) and it looks as though, while CalculateDataRange is still present, it isn’t called when a data point is added to the chart.
My questions are:
a) Since then, is there a better way to create a scrolling window of data?
b) If not, what has taken the place of CalculateDataRange if I were to again attempt to intervene in the calculation of the visible data range when a point is added?
Thank you for getting in touch. Concerning your question, the CalculateDataRange() method is called only in the getter of the DataRange property on axis. This is done for performance reasons. The property is used by SciChartScrollbar (Overview), so maybe you stopped using the Overview control and thus the method isn’t called any more.
Besides the DataRangeChanged event, there is a possible alternative in providing a custom ViewportManager. It gives you full control over VisibleRanges on all axes. I think it is the best candidate for your purposes.
Hope this helps!
Please login first to submit.