First question here. I'm doing an Arduino serial port plotter with Java and JFreeChart. Everything's working fine with the DynamicTimeSeries dataset, as I'm able to plot data nice and softly.
What I need to do now is this: given an established period of time (let's say 60 seconds) I want to plot the DynamicTimeSeries dataset on the chart for that period without moving the axis; I mean, like drawing a line for 60 seconds on the fixed chart.
Is there any way to do this? Every example I've watched shows the x-axis (time axis) start running along with the series.
If I'm not clear enough please let me know.
Any help will be deeply appreciated!
Thanks!
PS: my code is based on this: Using JFreeChart to display recent changes in a time series, and this: JFreeChart: DynamicTimeSeries with period of n milliseconds
For a
60
second chart, I'd expect domain indexes in the range0..59
. Depending on your requirements,You can put the next value at index
0
, orYou can invoke
advanceTime()
and put the next value at index59
.Also consider invoking
setDateFormatOverride()
on the domain axis, as shown here. See also Real time graph plotting starting time and this answer about UsingSwingWorker
withJFreeChart
.