List of usage examples for org.jfree.chart.axis NumberAxis setTickUnit
public void setTickUnit(NumberTickUnit unit, boolean notify, boolean turnOffAutoSelect)
From source file:net.sf.jasperreports.charts.util.ChartUtil.java
public void setAutoTickUnit(NumberAxis numberAxis) { if (numberAxis.isAutoTickUnitSelection()) { Range range = numberAxis.getRange(); if (range.getLength() >= AUTO_TICK_UNIT_THRESHOLD) { // this is a workaround for a floating point error makes JFreeChart // select tick units that are too small when the values are very large double autoSize = range.getLength() / AUTO_TICK_UNIT_THRESHOLD; TickUnit unit = numberAxis.getStandardTickUnits().getCeilingTickUnit(autoSize); numberAxis.setTickUnit((NumberTickUnit) unit, false, false); }//from w ww. j ava 2 s. c om } }