Kmel
Kmel

Reputation: 285

MPAndroidChart: How to hide chart background?

I'm using MPAndroidChart library v2.0.8. I can modify the background just outside the barchart but inside, there is still a grey background and I don't know which method I can use.

barchart = (BarChart) findViewById(R.id.chart);
barchart.setBackgroundColor(getRessouces().getColor(R.color.default_color));

I have this result :

enter image description here

I would like the default color into the chart too.

Thanks a lot,

Kamel

Upvotes: 3

Views: 2203

Answers (1)

Philipp Jahoda
Philipp Jahoda

Reputation: 51431

Have a look at the documentation.

You can remove or modify the background behind the "drawing-area" with these two methods:

  • setDrawGridBackground(boolean enabled): If enabled, the background rectangle behind the chart drawing-area will be drawn.
  • setGridBackgroundColor(int color): Sets the color the grid-background should be drawn with.

Upvotes: 3

Related Questions