I've a problem drawing ticks on my chart.
At the moment it looks like this:

but it should look like this:

Below is the code that I've tried so far:
Code: Select all
JFreeChart myLineGraph = ChartFactory.createXYLineChart(title,
xAxis, yAxis, xyDS, PlotOrientation.VERTICAL, setLegend,
setTooltip, false);
// Adding the Tooltips
XYPlot plot = myLineGraph.getXYPlot();
//create logarithmic axis
LogarithmicAxis rangeAxis = new LogarithmicAxis("Log(y)");
rangeAxis.setAllowNegativesFlag(true);
rangeAxis.setAutoRangeNextLogFlag(false);
rangeAxis.setAutoTickUnitSelection(false);
rangeAxis.setTickLabelsVisible(true);
rangeAxis.setTickUnit(new NumberTickUnit((rangeAxis.getRange().getUpperBound() - rangeAxis.getRange().getLowerBound()) / 5));
//set axis
plot.setRangeAxis(rangeAxis);
}
ToolTipGenerator gen = new ToolTipGenerator();
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setToolTipGenerator(gen);
renderer.setDrawSeriesLineAsPath(true);
renderer.setShapesFilled(false);
renderer.setBaseShapesVisible(false);
plot.setRenderer(renderer);
regards
Stephan