J

jfreechart で軸目盛の変更

jfreechart で軸目盛を変更したいときは,NumberFormatやTickUnitsクラスを利用

JFreeChart chart = ChartFactory.createHistogram(title, xAxisLabel, yAxisLabel,createData(x, bins), PlotOrientation.VERTICAL, legend, true, true);

XYPlot plot = (XYPlot) chart.getPlot();

ValueAxis xAxis = plot.getDomainAxis();

// 表示形式を指数とかで
((NumberAxis) xAxis).setNumberFormatOverride(new DecimalFormat("0.0E0"));

// 目盛間隔を変更
TickUnits tickUnits = new TickUnits();
TickUnit unit = new NumberTickUnit(1000); //ここで刻み値を決める
tickUnits.add(unit);

xAxis.setStandardTickUnits(tickUnits);

これで1000刻みになる.