ValueAxis.setFixedAutoRange() problem

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
SomeOtherUser
Posts: 13
Joined: Thu Apr 06, 2006 7:55 pm

ValueAxis.setFixedAutoRange() problem

Post by SomeOtherUser » Fri Nov 03, 2006 9:32 pm

I'm using a CombinedDomainXYPlot that contains XYPlots using TimeSeriesCollections and a DateAxis on the domain. When I set the fixed autorange, the plots don't update. I can't figure out why.

Code: Select all

TimeSeriesCollection[] datasets = new TimeSeriesCollection[] {
	new TimeSeriesCollection(), new TimeSeriesCollection(),
	new TimeSeriesCollection(), new TimeSeriesCollection()};
		
for(int i = 0; i < datasets.length; i++)
	datasets[i].addSeries(new TimeSeries());

xAxis = new DateAxis();
		
XYDotRenderer renderer = new XYDotRenderer();
		
plot = new CombinedDomainXYPlot(xAxis);
for(int i = 0; i < datasets.length; i++)
{
	plot.add(new XYPlot(datasets[i], xAxis,
		new NumberAxis("" + i), renderer));
}
getContentPane().add(new ChartPanel(new JFreeChart(null, null, plot, false)));

// Set range to a moving 1-hr.
xAxis.setFixedAutoRange(3600000);

// Plot has not redrawn!
Am I doing something wrong?

Thank you for your help.

Locked