Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#125 Dataset change / axis update

open
nobody
General (896)
5
2012-11-27
2003-03-04
David Gilbert
No

From the JFreeChart forum:

My application's main TimeSeriesChart displays 24
hours' worth of minute-by-minute data, or 1440 time
values in all. Data collected from some 28 different
sources are held in memory, and a menu allows the user
to select any one of about 25 data sources. (All of the
data in question comes from exactly the same 24-hour
timespan.) The code that loads the new dataset does
call "fireDatasetChanged()", and the plot does indeed get
updated to show the new data.
Because some sets of data have much larger full-scale
ranges than others, jFreeChart's autoranging often
produces longer (or shorter) TickUnitLabels for the
vertical axis, causing it to shift left or right. This in turn
may expand or contract the space available for the
x-axis, so it now gets rescaled, moving the hourly
tickmarks either farther apart or closer together.
However, when that happens, the displayed data
does NOT get correspondingly stretched or squeezed. -
so (for example) data from 23 hours ago now stands
labelled as if it was only 22 hours old. Changing the
x-axis scale should, of course, trigger redrawing the data
itself - is there a new fireWhatever() method that needs to
be called along with fireDatasetChanged()

Discussion