dataset.setValue(200.0, "Row 1", "Column 2");
JFreeChart chart = ChartFactory.createLineChart("Test", "Categories",
"Value", dataset, PlotOrientation.VERTICAL, false, false,
false);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
LogAxis axis = new LogAxis("Log(Y)");
plot.setRangeAxis(axis);
assertEquals(96.59363289248458, axis.getLowerBound(), EPSILON);
assertEquals(207.0529847682752, axis.getUpperBound(), EPSILON);
// now replacing the dataset should update the axis range...
DefaultCategoryDataset dataset2 = new DefaultCategoryDataset();
dataset2.setValue(900.0, "Row 1", "Column 1");
dataset2.setValue(1000.0, "Row 1", "Column 2");
plot.setDataset(dataset2);
assertEquals(895.2712433374774, axis.getLowerBound(), EPSILON);
assertEquals(1005.2819262292991, axis.getUpperBound(), EPSILON);
}