I am trying to use PeriodAxis in a chart to graph some time series data. The first data point occurs at 2012-01-08 19:00:00 and the final data point occurs at 2012-01-09 19:00:00.
When the chart is drawn, the tick labels start at 19:29 and end at 19:29. I want them to start at 19:00 and end accordingly -- that is, I don't want the :29 minute fractions. I have tried to set the tick label increments to 1 hour increments using setStandardTickUnits(), but that didn't change anything. I can't seem to find any other methods for this class that would allow me to change the tick units.
Sample code:
PeriodAxis domain = new PeriodAxis(null, new Hour(19, new Day(8, SerialDate.JANUARY, 2012)),
new Hour(19, new Day(9, SerialDate.JANUARY, 2012)));
domain.setAutoRangeTimePeriodClass(Hour.class);
PeriodAxisLabelInfo[] periodLabels = new PeriodAxisLabelInfo[2];
periodLabels[0] = new PeriodAxisLabelInfo(Hour.class, new SimpleDateFormat("HH:mm"));
periodLabels[1] = new PeriodAxisLabelInfo(Day.class, new SimpleDateFormat("MMM dd, yyyy"));
domain.setLabelInfo(periodLabels);
domain.setLowerMargin(0);
domain.setUpperMargin(0);
TickUnits tu = new TickUnits();
tu.add(new DateTickUnit(DateTickUnit.HOUR, 1));
domain.setAutoTickUnitSelection(true);
domain.setStandardTickUnits(tu);