hi,
i tried to modify the rangeaxis of an vertical bar chart (created with
jfreechart version 0.9.4) to NOT display any non-integer values
(by setting the minimum spacing between two labels to 1).
you can find an image of my drawn chart @
http://www.novanet.at/art/jfree/za.gif
the point is: this chart represents the number of people which
choosed the option 1,2,3 ... - there is no way that option x has
been choosen by 0,05 people =)
thanks for any response
art
how to avoid non-decimal values in axis labels
Re: how to avoid non-decimal values in axis labels
You can replace the TickUnits collection on the range axis with an integer-only collection:
CategoryPlot plot = myChart.getCategoryPlot();
NumberAxis axis = (NumberAxis) getRangeAxis();
TickUnits collection = NumberAxis.createIntegerTickUnits(); // or create your own custom collection
axis.setStandardTickUnits(collection);
Regards,
Dave Gilbert
CategoryPlot plot = myChart.getCategoryPlot();
NumberAxis axis = (NumberAxis) getRangeAxis();
TickUnits collection = NumberAxis.createIntegerTickUnits(); // or create your own custom collection
axis.setStandardTickUnits(collection);
Regards,
Dave Gilbert
Re: how to avoid non-decimal values in axis labels
exactly what i wanted!
damn, i knew that the solution is simple but i still overlooked it.
thanks for the quick response!
art
damn, i knew that the solution is simple but i still overlooked it.
thanks for the quick response!
art