DateAxis: showing every hours for a day.

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
kyunam
Posts: 9
Joined: Wed Jan 28, 2004 3:10 am

DateAxis: showing every hours for a day.

Post by kyunam » Fri Feb 06, 2004 5:43 pm

org.jfree.chart.axis.DateAxis axis = (org.jfree.chart.axis.DateAxis)plot.getDomainAxis();
axis.setTickUnit(new org.jfree.chart.axis.DateTickUnit(org.jfree.chart.axis.DateTickUnit.HOUR, 1), false, false);

If my values fall in the range of 2:00 am - 2:00 pm, DateAxis still starts from 2:00 am and ends at 2:00 pm.
I want to DateAxis to show every hour between 12:00 am to 12:00 pm no matter what.

Thanks you in advance.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Fri Feb 06, 2004 5:55 pm

You can use the setRange() method to specify the axis range.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked