Range

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

Range

Post by Fredrik » Sun Jan 26, 2003 4:02 pm

Hi
I'm a newbie to JFreeChart. First of all, I think the SimpleDemo on the sourceforge page should be updated, many of the clases it uses are renamed now (took me some time to figure out :)).

I want to plot temperature vs time. The x-axis should be ranging from 00 to 24 (hours) and there should be no extra space outside this range. How do I achieve this? I would also like to set the range on the y-axis manually, is it possible? I've looked through the API's, but I cannot find any methods for it.

To construct the plot, I use createTimeSeriesChart(...) and to create a dataset I make a BasicTimeSeries containing values for each minute between 00:00 and 24:00, and finally I put the BasicTimeSeries in a TimeSeriesCollection.

Thanks for a good plotting lib.

Regards
Fredrik

Arnaud

Re: Range

Post by Arnaud » Sun Jan 26, 2003 8:36 pm

Hello Fredrik,

I'm a newbie too, but will try to answer Your questions :

1) concerning the demo :
I used the demo.jar file included in the jfreechart-0.9.4 zip files, which works with Swing examples : works fines, and gives a good overview. If You mean the servlet demo... I would be able to help You as I did not look at it.

2) how to change the min/max values of axis :
Take a look at the ValueAxis class and more particulary on those methods :
- setMaximumAxisValue(double)
- setMinimumAxisValue(double)
- setRange(double, double)

to avoid the Range to be recalculated after a zoom is performed, You should although set the AutoRange property to false using the setAutoRange(boolean) method.

Hopes it will help You,
Regard, Arnaud

Fredrik

Re: Range

Post by Fredrik » Sun Jan 26, 2003 9:34 pm

Thanks, you really gave me a push in the right direction. Got everything to work now.


The demo that is broken can be found on:
http://sourceforge.net/docman/display_d ... p_id=15494

I did get that to work, but It might scare other newbies as it is broken.

David Gilbert

Re: Range

Post by David Gilbert » Mon Jan 27, 2003 9:29 pm

I will hide that old demo...now that there are dozens of demo applications in src/com/jrefinery/chart/demo there is no need for it.

Regards,

Dave Gilbert

Locked