My issue:
I am building a bar chart in Pentaho report designer, where depending on the parameters, the max value in the chart can be huge (say 1,000) or very small (say 3). Currently when the max range is huge, the auto-tick interval works nicely. However, when the max value is very small, I get Y Axis ticks of, for example, 0.5, 1.0, 1.5, 2.0 etc. The customer is not happy with this, as decimal (non-whole number) values do not make sense. I need to find a way to control the minimum tick interval on the Y Axis.
My question:
Can any one please provide some code which I can use to solve this problem? It would be great if you could also clarify what language the code is in (some exmaples I see are in BeanShell and others in Javascript and I can't tell the difference, and I have to select which language to use) and if there are any packages I need to import - the complete solution.
I have tracked down a few examples, like the following:
Code: Select all
NumberAxis range = (NumberAxis)plot.getRangeAxis();
range.setTickUnit(new NumberTickUnit(20));
Thanks for any help!