fireChartChanged() in JfreeChart

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

fireChartChanged() in JfreeChart

Post by RC » Wed Apr 17, 2002 2:11 pm

In JFreeChart 0.5.6 the fireChartChanged() method in JFreeChart class
used to be public. Now in 0.8.1 it changed to protected.

I can't compiled MyClass in MyClass.java file any more
when I call the myChart.fireChartChanged();

David Gilbert

Re: fireChartChanged() in JfreeChart

Post by David Gilbert » Wed Apr 17, 2002 3:47 pm

In theory, you should never have to call fireChartChanged(), it is for internal use. It shouldn't be possible to change the state of the chart without it calling fireChartChanged() for you.

If you give me some info about why you are calling:

myChart.fireChartChanged()

...I'll tell you if there is an alternative way to get the same result. Or it is possible that you've uncovered a problem in the event mechanism, which I will fix...

Regards,

DG.

RC

Re: fireChartChanged() in JfreeChart

Post by RC » Wed Apr 17, 2002 4:43 pm

David Gilbert wrote:

> If you give me some info about why you are calling:

> myChart.fireChartChanged()

> ...I'll tell you if there is an alternative way to get the same result. Or it is possible that you've uncovered a problem in the event mechanism, which I will fix...

I am writing a DCP (data collection platform) chart to display data.
Each DCP has different sensors, TA -- tempertures (in F' or C'),
US -- wind speed (mile/hour or meter/hour), HG -- River Stage
(Ft, inch or meter, cm), PC -- Precipitation accumulateor (Inches or cm),
etc.

I used TimeSeriesChart to display, only display ONE sensor of data a time.
Because they are different things. I create a JList for TA, US, HG, PC.
So when an user selected a sensor from the JList, the JFreeChart will
reload the data and redraw.

Well I done that OK. But each time reload and redraw. I always reset the
min and max values for VerticalNumberAxis. But the min always display to
0.0 on chart. event I set the min to 5.0 and max to 6.0
I think in JFreeChart 0.5.6, it works fine with me when I call
the fireChartChanged() method.

So far I only check the VerticalNumberAxis, I have check the
HorizontalDateAxis yet. I am try to do zoomin/zoomout by changed
the minDate and maxDate.

David Gilbert

Re: fireChartChanged() in JfreeChart

Post by David Gilbert » Wed Apr 17, 2002 5:21 pm

You can call setAutoRangeIncludesZero(false) on the vertical number axis, and then whenever you change your data the axis will automatically readjust to the maximum and minimum values.

Regarding zooming, I have a contribution from a developer for selecting a rectangular area and zooming in on that area. I hope to include that in the next version of JFreeChart.

There's also a new ThermometerPlot that might be of interest to you, coming soon...

Regards,

DG

Locked