Is there a way to wrap a label on the word break?
If you look at the graphs at
http://test.rhoderunner.com/hragraph/readme.html
I would like to break the words "minimal risk" moderate risk" etc into 2 lines so I can increase the font and improve readability.
Can anyone tell me how I can set the font for the categories (Cancer, Heart Disease, etc)?
Thanks.
Wrappable Labels?
Re: Wrappable Labels?
Hi Phillip,
I'm assuming you have used the HorizontalMarkerAxisBand class to display the "minimal risk", "moderate risk" etc. This doesn't have the facility to split the labels onto multiple lines, but you could probably modify the drawStringInRect(...) method to achieve that.
Setting the font for the vertical category axis is easy:
CategoryPlot plot = myChart.getCategoryPlot();
CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setTickLabelFont(new Font(...));
Regards,
DG
I'm assuming you have used the HorizontalMarkerAxisBand class to display the "minimal risk", "moderate risk" etc. This doesn't have the facility to split the labels onto multiple lines, but you could probably modify the drawStringInRect(...) method to achieve that.
Setting the font for the vertical category axis is easy:
CategoryPlot plot = myChart.getCategoryPlot();
CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setTickLabelFont(new Font(...));
Regards,
DG