Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android - change achartengine graph background color

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?

like image 750
Umang Avatar asked Sep 15 '11 05:09

Umang


3 Answers

in GraphicalView.java 's onDraw() method add this line

mRenderer.setApplyBackgroundColor(true);
mRenderer.setBackgroundColor(Color.RED);

it will work

like image 72
Mohammed Azharuddin Shaikh Avatar answered Oct 22 '22 20:10

Mohammed Azharuddin Shaikh


you can add this and enjoy it!

mRenderer.setMarginsColor(Color.RED);
like image 44
Sara Zakizadeh Avatar answered Oct 22 '22 20:10

Sara Zakizadeh


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.

like image 30
Dan D. Avatar answered Oct 22 '22 19:10

Dan D.