Chibuike Mba
Chibuike Mba

Reputation: 327

How to change Codename One Chart background color

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?

Upvotes: 2

Views: 185

Answers (2)

Chibuike Mba
Chibuike Mba

Reputation: 327

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

Upvotes: 2

James H
James H

Reputation: 1116

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

Upvotes: 2

Related Questions