The graph starts at 16 minutes and 40 seconds after midnight on the date used to construct the Second
passed to setTimeBase()
. This is the same 1000 intervals, each one second long, specified in the nMoments
constructor parameter. Some possible alternatives to get a zero-based display, given a time set to midnight.
-
Make
nMoments
a multiple of60
.dataset = new DynamicTimeSeriesCollection(1, 960, new Second()); dataset.setTimeBase(new Second(0, 0, 0, 1, 1, 2014));
-
Subtract
nMoments
from the nominal base date.int nMoments = 1000; dataset = new DynamicTimeSeriesCollection(1, nMoments, new Second()); Calendar c = Calendar.getInstance(); c.setTime(new Date(0)); c.add(Calendar.SECOND, -nMoments); dataset.setTimeBase(new Second(c.getTime()));
Either approach yields the same display.