0

Is there a way to wrap plot label for Category axis?

I'm facing a problem where these titles merge between the plots. It would be best if they would wrap at least once. Is it possible?

The titles are dynamic. enter image description here

Here's the classes I use to construct it.

var renderer = new LineAndShapeRenderer();
...
var yAxis = new NumberAxis();
...
var xAxis = new CategoryAxis(title);
...
CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer);
...
var combinedPlot = new CombinedRangeCategoryPlot();
combinedPlot.add(plot, weight);
...

I'm using version 1.0.19 of JFreeChart since newer versions produce some visual artifacts.

  • 1
    AFAIK, axis label wrapping is not supported, although multiple axes, each with its own label, are permitted, for [example](https://stackoverflow.com/a/13362809/230513); alternatively, tooltips support wrapping in HTML. – trashgod Dec 06 '21 at 18:54
  • 1
    @trashgod Thanks for your input. Might have to resort to splitting the title contents between two axis. – Herberts Markūns Dec 07 '21 at 08:54

0 Answers0