Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
150
xamdatachart: how to build a sliding-window
posted

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

Parents
  • 30692
    Suggested Answer
    Offline posted

    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

Reply Children