Hi,
my chart is bound to a growing time series, but I would like to display a sliding-window of fixed size containing the last data. I use FinancialPriceSeries and CategoryDateTimeXAxis. How can I achieve this?
Thanks in advance,
Jerome
Jerome,
On some interval, you can add new points to a collection, and then check for points at the beginning of the collection that are too old and remove them. As long as your collection implements INotifyCollectionChanged the chart should be notified of these modifications and adjust accordingly. If you were using CategoryXAxis I would recommend just removing a fixed number of points from the beginning, and adding the same fixed number of points to the end on that interval, and that would keep the window sliding evenly. But the case is a bit more complex with CategoryDateTimeXAxis. Depending on your data you may need to do additional things to keep the window action smooth. It can end up being a bit compicated if you don't have the ability to set the minimum and maximum on the CategoryDateTimeXAxis. Fortunately, I believe we allow this in the latest service release for 10.3. Which version are you currently using?
-Graham
Hi Graham,
Thank you for the reply!
The sliding-window should run even if the oldest data are not removed (I want the chart to implement the sliding-window independently of the data that the chart observes). In any case, the way consisting of removing the last data doesn't work with CategoryDateTimeXAxis, as you already noticed, because the time-span being removed is not garanteed to be equal to the time-span being added.
So I intend to implement the sliding-window by setting on my own the min-max of the xaxis... Unfortunately, the min-max is not settable in the latest service release 10.3. It should be ok, if I set the WindowRect of the chart itself? Can you confirm? If you have a similar code sample, I would enjoy to have a look to the implementation...
Thanks,