I am using JFreeChart to render a LineChart using CategoryPlot. Something like:
JFreeChart chart = ChartFactory.createLineChart("Daily Revenue",
"Days", "Revenue", dataset);
CategoryPlot plot = chart.getCategoryPlot();
So as you can understand I must have to display full Time like 23 Feb'18 11:00:00
on the XAxis tilted to 45degrees which I am able to achieve using
CategoryAxis categoryAxis = chart.getCategoryPlot().getDomainAxis();
categoryAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
But I want to display my text on XAxis in 2 lines somewhat like:
23 Feb'18
11:00:00
tilted to 45 degrees. For which I had tried using
CategoryAxis categoryAxis = chart.getCategoryPlot().getDomainAxis();
categoryAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
categoryAxis.setMaximumCategoryLabelLines(5);
with no success so how can I achieve that??