I appologize if this has been answered before but I need an answer. I'm making a TimeSeriesChart that keeps track of 3 days worth of data that comes in 8 hour increments (So 9 data points at a time) I have everything working except for the Domain axis:
Code: Select all
timeChart.getXYPlot().getDomainAxis().setFixedAutoRange(259200000); //3 Days
((DateAxis)timeChart.getXYPlot().getDomainAxis()).setTickUnit(new DateTickUnit(DateTickUnit.HOUR, 8, new SimpleDateFormat("dd - HH")));
The following sets it to always display 3 days worth on the axis at a time, so that the tick intervals are in 8 hour ticks. The only problem is, as data is entered into the graph the axis shifts a little bit and instead of having the tick marks at 0 hours, 8 hours, 16 hours, etc. They're at 7 hours, 15 hours, 23 hours, etc. Is there a way to force the tick marks to always be at 0, 8, 16, 0, 8, 16 etc. I understand that at times the axis would start at the 8 tick or the 16 tick, but I don't want it to shift them to odd numbers.
Any help or suggestions would very much be appreciated. Thanks.