0

I am using achartengine and i am trying to draw rectangles, circles inside it, i have seen the ChartView.draw(Canvas) method but i dont know if it work on this way:

mChartView = ChartFactory.getLineChartView(this, dataset, mRenderer);
setContentView(mChartView);

Canvas a = new Canvas();
Paint p = new Paint();
p.setColor(Color.GREEN);
a.drawCircle(70, 80, 40, p);
mChartView.draw(a);
mChartView.repaint();

Is that code suppose to draw a green circle onto the chart ? Because the chart whit the series is being draw but not the circle.

Andres
  • 6,080
  • 13
  • 60
  • 110

1 Answers1

0

Keep in mind that the Android Canvas uses a painter's algorithm, so order matters. You probably aren't seeing the circle because the chart gets drawn afterwards and, thus, on top of the circle. If you reverse the calls (i.e. do mChartView.draw() before a.drawCircle() you should see the circle over the top of the chart.

HTH

devunwired
  • 62,780
  • 12
  • 127
  • 139