Display graph with no values on DateAxis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Del

Display graph with no values on DateAxis

Post by Del » Thu Jan 09, 2003 6:56 am

Hi,

I am having a problem with my line graph. For horizontal axis I use the HorizontalDateAxis to display date. The line graph for most situation is displayed rather nicely. However, there are situations where there are no values at the beginning or end of the graph, the date range of the graph is trimmed. Is there any way to force the graph to to display the dates with no values specified?

I am not certain, but I think in the NumberAxis class there is a method setAutoRangeIncludesZero() that can do the job if the axis uses number instead of date. Is there a similar method for the DateAxis class?

David Gilbert

Re: Display graph with no values on DateAxis

Post by David Gilbert » Thu Jan 09, 2003 7:08 am

Hi Del,

By default, JFreeChart automatically sets the axis ranges to match the minimum and maximum values in your dataset (plus a small margin). But you can always override that by setting a range manually...use one of the setRange(...) methods inherited from the DateAxis class.

Regards,

Dave Gilbert

Locked