I have a combined plot in JFreechart consisting of 4 timeseries charts with a common time domain axis.
The data for the subplots arrives at different rates. For example I may receive a price change event every couple of miliseconds and a position change every minute. I'm currently rendering these series with the XYStepRenderer to produce a step charts.
I'd like to be able to do something like this:
- A Price point is received at time T and is plotted on chart
- No data has been received at time T for the position chart and so we assume that the value has not changed and the previous position value is rendered - i.e. extending the step line horizontally
- At time T+1 a position point is received and is plotted changing the step chart
- At time T+1 no price point has been received and so the previous price is plotted
Is there any easy way to do this in JFreechart? Currently I have a working implementation but this does not handle rendering the assumed values.
My initial thoughts have been around changing the data model so that I can quickly find the previous value and to change the calls to tell each subplot to draw when an event is received for any plot.