Question

I am trying to place a text annotation at the centre of a donut graph in TeeChart for Android. However, the position does not seem to move. I have the following:

   tc = new TChart(context);
   dn = new Donut(tc.getChart());

   dn.add(goal,Color.white);
   dn.add(data);

   // percentage size of middle hole
   dn.setDonutPercent(60);

   tc.addSeries(dn);
   view.addView(tc);
   Annotation a = new Annotation(tc.getChart());
   a.setText("12.34" + "%");
   a.setLeft(100);
   a.setTop(100);

Any help appreciated.

Was it helpful?

Solution

Add this before setting the position of the Annotation:

a.getShape().setCustomPosition(true);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top