I draw a two-dimensional graph in which I set ranges for both axes by certain values. But when I select the graph menu 'auto range > both axes' I get other ranges (maybe obviously).
I want to set auto range into my defined range, with my values. How can I do this?
XYPlot xyPlot = chart.getXYPlot();
NumberAxis domainAxis = (NumberAxis) xyPlot.getDomainAxis();
domainAxis.setRange(minXChart, maxXChart);
domainAxis.setTickUnit(new NumberTickUnit(xTickInterval));
rangeAxis.setRange(minYChart, maxYChart);
rangeAxis.setTickUnit(new NumberTickUnit(yTickInterval));
graph with defined range (i want exactly the same but with auto range)
graph with auto range (bad looking)