Home » Android » android – change achartengine graph background color

android – change achartengine graph background color

Posted by: admin June 15, 2020 Leave a comment

Questions:

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?

How to&Answers:

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

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

it will work

Answer:

you can add this and enjoy it!

mRenderer.setMarginsColor(Color.RED);

Answer:

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.