Is there a way to change the background color of the graph intent when using achartengine? Currently, it displays all the graphs with a black background. I looked into GraphicalActivity.java but couldnt find a solution. Anyone?
Asked
Active
Viewed 6,572 times
3 Answers
17
in GraphicalView.java
's onDraw()
method add this line
mRenderer.setApplyBackgroundColor(true);
mRenderer.setBackgroundColor(Color.RED);
it will work

Seraphim's
- 12,559
- 20
- 88
- 129

Mohammed Azharuddin Shaikh
- 41,633
- 14
- 96
- 115
-
thanks. It worked. One more doubt - Im using a pie chart, and it only displays the chart, but not the values. Is there a way to display the values on the screen? – Umang Sep 15 '11 at 05:57
-
ya you can, but for that you have to brush up your mind, try buddy – Mohammed Azharuddin Shaikh Sep 15 '11 at 06:00
-
it would be great if you could tell me :) – Umang Sep 15 '11 at 06:05
-
actually lil busy, i think you should try it by your own its really a good experience for you – Mohammed Azharuddin Shaikh Sep 15 '11 at 06:06
-
i would prefer you to ask another question on SO, if anyone knows surely they will help – Mohammed Azharuddin Shaikh Sep 15 '11 at 06:29
-
let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/3485/discussion-between-umang-and-hotveryspicy) – Umang Sep 15 '11 at 09:28
-
mRenderer.setApplyBackgroundColor(true); is the key point here. I applied setBackgroundColor() before, but it had no effect. Thanks! – class Android May 06 '16 at 08:06
2
The response is correct, but you don't have to do that in the GraphicalView.java. You should do that in your own class building the renderer for the chart.

Dan D.
- 32,246
- 5
- 63
- 79