I'am using jasperReport/ireport 4.0
Using jasper I generate a report contain barChart that contain a lot of informations, The number on the x axis is not clear and precise ,from the chart I cant tell how many issue I have , when the user read the report he can't tell the rig开发者_JAVA技巧ht value
How can I minimise the scale to have more detailed number?
My chart:
You'll need to use a chart customizer class to do this. Create a class that implements the JRChartCustomizer interface, then in the customize() method add the following code:
CategoryPlot plot = (CategoryPlot)jFreeChart.getPlot();
ValueAxis verticalAxis = plot.getRangeAxis();
TickUnits verticalTicks = new TickUnits();
verticalTicks.add(new NumberTickUnit(1));
verticalTicks.add(new NumberTickUnit(2));
verticalTicks.add(new NumberTickUnit(5));
verticalTicks.add(new NumberTickUnit(10));
verticalAxis.setStandardTickUnits(verticalTicks);
The chart engine should always pick the smallest tick unit that does not cause the ticks to overlap. Using this code your chart should hopefully place ticks at every value or every 2 values.
精彩评论