Reputation: 9400
I know how to create a CategoryPlot and then set the DomainAxis labels to use two lines. This is the idea:
CategoryAxis categoryAxis = categoryPlot.getDomainAxis();
categoryAxis.setMaximumCategoryLabelLines(2); // Mmmm... nice labels
But I'm having trouble doing "the same thing" for a Timeseries chart. The problem is that the DateAxis is a ValueAxis rather than a CategoryAxis. That makes sense because the dates are values. But I don't like the look of the chart when it uses only a single line for the date. You can see a sample chart in my answer in this thread. I want to format my dates to use 2 lines. But I cannot do it like this:
DateAxis dateAxis = (DateAxis)xyPlot.getDomainAxis();
dateAxis.setMaximumCategoryLabelLines(2); // method does not exist
How can I get those Date labels onto 2 lines?
Upvotes: 0
Views: 1595