Aleksandr Kravets
Aleksandr Kravets

Reputation: 5947

JFreeChart: Is there a way to draw long tick labels in two lines in XYPlot

I've got legacy code sample which uses JFreeChart and XYPlot. Now i'm making i18n for that code and most of non-english strings are much longer then english ones. I googled for a way to wrap strings. No success. Help please!

Upvotes: 3

Views: 2996

Answers (2)

Jakub Godoniuk
Jakub Godoniuk

Reputation: 404

Try using setMaximumCategoryLabelLines method from CategoryAxis, e.g:

CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setMaximumCategoryLabelLines(3);

Upvotes: 11

trashgod
trashgod

Reputation: 205785

Multiple lines are not supported. The setVerticalTickLabels() method may be applied to either a domain or a range axis. Because space is limited, interpreters should be frugal. Providing a user setting, as shown here, may mitigate the limitation.

Upvotes: 2

Related Questions