SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components


I’m not clear how you set up FIFO with the SciStockChart class and mvvm; docs are a little weak; all the examples seem to use datasets rather than ChartSeriesViewModel. Do I simply set the fifocapacity? Do I need to set it at instantiation? Do all the ChartSeriesViewModels in a collection need to have the same Fifocapacity? Can I change the fifocapacity at runtime; and if so how would I change the capacity of all of the ChartSeriesViewModels (assuming they must all be the same) in a collection?

thanks in advance.

  • You must to post comments

Hi there,

Hmmm, we haven’t tried this (FIFO with SciStockChart). I do know many people have successfully used FIFO series with SciChartSurface / OhlcDataSeries to create a stock chart however.

Ok to answer some of your questions:

To denote a series as a FIFO Series, simply set the FIFO capacity on creation, e.g. 
 <pre class="brush: csharp; gutter: true; first-line: 1; highlight: []; html-script: false">
                var ds = new DataSeriesSet&lt;DateTime, double&gt;();
                var fifoSeries = new OhlcDataSeries&lt;DateTime, double&gt;() {FifoCapacity = 1000};
Or, in your case, since you are using ChartSeriesViewModel, simply declaring this series and binding to it (the DataSet is created internally). 

If one series in a DataSeriesSet is a FIFO Series, all other series must be FIFO series.
As far as I'm aware, you can simply change the FifoCapacity to alter the size, however this will have the effect of clearing existing data.
To update the FIFO Capacity of all series, my advice would be to replace data-series with new resized versions, copying any data you wish to copy in the process

I hope you understand, its not a common use-case hence not one we’ve created an example for!

Best regards,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.