2
votes

am trying to change the background of Chart Renderer but it's not working for all the chart types I have.

used this code

renderer.setApplyBackgroundColor(true);
renderer.setBackgroundColor(GlobalVal.CHART_BG_COLOR);

and it worked for DoughnutChart but did not work for BarChart & CubicLineChart, shows black.

Is there any other method I should call?

2
Did you use XYMultipleSeriesRenderer or some other renderer? - Shai Almog
Yes, I used XYMultipleSeriesRenderer for BarChart and CubicLineChart but used DefaultRenderer for DoughnutChart following the examples from the demo. - Chibuike Mba

2 Answers

2
votes

You can try putting it into its own container and style the container with a UIID. Chart styling seems pretty tricky.

2
votes

Have figured it out renderer.setMarginsColor(GlobalVal.CHART_BG_COLOR); did the job.