8

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?

Umang
  • 583
  • 2
  • 12
  • 28

3 Answers3

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
6

you can add this and enjoy it!

mRenderer.setMarginsColor(Color.RED);
Sara Zakizadeh
  • 137
  • 1
  • 8
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