Auto Range is of no effect
Re: Auto Range is of no effect
I'm not sure. Can you describe the context in which you call setAutoRange(true)? What you see, and what you expected to see?
Regards,
Dave Gilbert
Regards,
Dave Gilbert
Re: Auto Range is of no effect
public VerticalNumberAxis createVerticalNumberAxis(){
VerticalNumberAxis vna=new VerticalNumberAxis("value");
// vna.setGridPaint(Color.cyan);
// vna.setInverted(true);
vna.setAutoRange(false);
vna.setAutoRange(true);
// vna.setMaximumAxisValue(50.0);
// vna.setMinimumAxisValue(-50.0);
return vna;
}
public void createVerticalBarChart(){
JFreeChart barChart=ChartFactory.createVerticalBarChart("Price Chart","Category","Price",new DefaultCategoryDataset(seriesName,categoriesName,data),true);
barChart.getPlot().setVerticalAxis(createVerticalNumberAxis());
try{
ChartUtilities.saveChartAsPNG(new File("test.png"),barChart,600,600);
}catch(IOException e){
System.out.println(e.getMessage());
}
}
Whether setAutoRange(true) or setAutoRange(false),the max and min value of the axis always equal to 1.00 and 0.00 as long as you set the axis.
VerticalNumberAxis vna=new VerticalNumberAxis("value");
// vna.setGridPaint(Color.cyan);
// vna.setInverted(true);
vna.setAutoRange(false);
vna.setAutoRange(true);
// vna.setMaximumAxisValue(50.0);
// vna.setMinimumAxisValue(-50.0);
return vna;
}
public void createVerticalBarChart(){
JFreeChart barChart=ChartFactory.createVerticalBarChart("Price Chart","Category","Price",new DefaultCategoryDataset(seriesName,categoriesName,data),true);
barChart.getPlot().setVerticalAxis(createVerticalNumberAxis());
try{
ChartUtilities.saveChartAsPNG(new File("test.png"),barChart,600,600);
}catch(IOException e){
System.out.println(e.getMessage());
}
}
Whether setAutoRange(true) or setAutoRange(false),the max and min value of the axis always equal to 1.00 and 0.00 as long as you set the axis.
Re: Auto Range is of no effect
OK, thanks for the sample code. I can see the problem against the 0.7.3 code (same as you) but it appears to be fixed in my current source tree (which will be 0.7.4 soon). That could be because of some changes I made while trying to track down a bug with the CombinedPlot class a couple of days ago.
I made quite a few changes here and there and I can't be sure which one(s) fixes the problem so you'll have to wait for 0.7.4 to be released (I hope next week).
Regards,
DG.
I made quite a few changes here and there and I can't be sure which one(s) fixes the problem so you'll have to wait for 0.7.4 to be released (I hope next week).
Regards,
DG.