Reputation: 1
JFreeChart Ring Chart total in center not breaking into multiple lines. Here is what I have tried, and here is my output:
I just want to create a JFreeChart which is used later to convert to BufferedImage
.
JFreeChart chartPage = ChartFactory.createRingChart("Incidents", donutDataset, true, true, false);
RingPlot donut = (RingPlot) chartPage.getPlot();
// donut.setCenterTextMode(CenterTextMode.VALUE);
donut.setCenterTextMode(CenterTextMode.FIXED);
String total = "Total :\\n 450";
// String total = "\<html\> Total \\n <br> :450 \</html\> ";
// JLabel totalLabel = new JLabel(total);
donut.setCenterText(total);
I have tried the commented scenarios have tried the JLabel as well as direct texts. Any way, it is coming only in single line I want to have it in multiple lines.
Upvotes: 0
Views: 81