Hi all,
The NumberTickUnit is no effect in the constructor of the VerticalNumberAxis.So if want to use this attribute,must call the VerticalNumberAxis.setTickUnit().
another bug report
Re: another bug report
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.