I have a multiaxis chart bar char and line chart. My customizer class has following code snippet.
@Override
public void customize(final JFreeChart chart, final JRChart jasperChart) {
final Plot plot = chart.getPlot();
if (plot instanceof CategoryPlot) {
final CategoryPlot cPlot = (CategoryPlot) plot;
final ValueAxis axis = new NumberAxis();
axis.setMinorTickMarksVisible(true);
axis.setMinorTickCount(1);
cPlot.setRangeAxis(axis);
} else if (plot instanceof XYPlot) {
final XYPlot xyPlot = (XYPlot) plot;
xyPlot.setRangeMinorGridlinesVisible(true);
}
}
The chart looks like
The scales are messed up and are not on the same line.
How can i fix this issue.
Any help appreciated.
Thanks