Hi!
I am plotting several real time datasets on the same chart. Each one is updated by its thread. When a new dataset value arrives all others are properly shifted as time passes by.
The problem I have is that after some time, some of the lines are not close to the right as the last updated line. Is there a way to extend the others lines?
A possible solution could be to create a new sample for each line, with the last time value and with the same value of the last sample.
Thanks and congratulations for the excellent work with this library,
Eduardo Ramalho
Last value on dynamic charts
Re: Last value on dynamic charts
Hi Eduardo,
Each series will only plot the values that it has, JFreeChart doesn't try to extrapolate at all. So for now the workaround is the one you mention, at each update you will have to populate all series, even if no new data is available for some...
Adding an extrapolation option to the renderer probably wouldn't be that difficult. You'd just have to add a check in the drawItem(...) method to see if the current item is the last - if it is, draw an extra line from the current point to the max axis value.
Regards,
Dave Gilbert
Each series will only plot the values that it has, JFreeChart doesn't try to extrapolate at all. So for now the workaround is the one you mention, at each update you will have to populate all series, even if no new data is available for some...
Adding an extrapolation option to the renderer probably wouldn't be that difficult. You'd just have to add a check in the drawItem(...) method to see if the current item is the last - if it is, draw an extra line from the current point to the max axis value.
Regards,
Dave Gilbert