I am trying to generate a donut or ring chart using jfree chart library. Ringchart was generated successfully but only the problem is centered text inside ring was not displaying. The following is the sample snippet. chart generation code
JFreeChart chart = ChartFactory.createRingChart(heading, dataSet, legend, tooltips, urls);
And centered text related code is like below
RingPlot pie = (RingPlot) chart.getPlot();
pie.setBackgroundPaint(Color.WHITE);
pie.setOutlineVisible(false);
pie.setShadowPaint(null);
pie.setLabelGenerator(null);
pie.setCenterTextMode(CenterTextMode.VALUE);
Font font = new Font("Arial",1,30);
pie.setCenterTextFont(font);
pie.setCenterTextColor(Color.getHSBColor(222, 1, 1));
pie.setSectionDepth(0.1);
pie.setSectionOutlinesVisible(false);
pie.setSeparatorsVisible(false);
pie.setIgnoreZeroValues(false);
I am using jfreechart verison 1.5.0


