Is there a way to update the text inside a Pie Chart (generated through the achartEngine API). I want to show the percentage there. In the picture below, I have it updated manually (i.e. 60%, 30% and 10%) to show you.
I could not find relevant method in the SimpleSeriesRenderer class. Here is the code I am using.
CategorySeries categorySeries = new CategorySeries("Chart");
for (int i = 0; i < series.size(); i++) {
categorySeries.add(series.get(i), series_data.get(i));
}
DefaultRenderer defaultRenderer = new DefaultRenderer();
defaultRenderer.setBackgroundColor(Color.BLACK);
defaultRenderer.setShowLabels(true);
defaultRenderer.setShowLegend(true);
defaultRenderer.setShowTickMarks(true);
defaultRenderer.setLabelsTextSize(40f);
defaultRenderer.setLegendTextSize(40f);
defaultRenderer.setApplyBackgroundColor(true);
for (int i = 0; i < series_data.size(); i++) {
SimpleSeriesRenderer simpleSeriesRenderer = new SimpleSeriesRenderer();
simpleSeriesRenderer.setColor( chartColor[i]);
defaultRenderer.addSeriesRenderer(simpleSeriesRenderer);
}

You can create custom class, which extends
PieChartand override it'sdrawLabel()(and may bedraw()) method:and use your
AdvancedPieChartclass instead of "standard"PieChart.Update:
For example, this implementation:
draw text "Hello" in the center of chart:
Layout (
activity_main.xml) for that:(of course You don't need nested layouts)
and
MainActivity.javais:(of course it's just demo).
And if You press
Ctrl+LeftMouseButtonwhen mouse pointer is onPieChartword in AndroidStudio 2.0 and above You can find many interesting things about inner organization ofPieChart, for example coordinates of pies centers etc.