Colibri
Colibri

Reputation: 587

How to hide the legend in MPAndroidChart?

Image

Hi, I am using MPAndroidChart and I am trying to make invisible this things whatever it names, i don't know. How can i delete this things in the red rectangle.

I found the answer somehow.

chart.getLegend().setEnabled(false);

Upvotes: 2

Views: 1003

Answers (1)

Philipp Jahoda
Philipp Jahoda

Reputation: 51431

What you are talking about is the Legend.

You can hide or show it with the following code:

Legend legend = chart.getLegend();
legend.setEnabled(false); // hide legend

By default, it is shown.

Upvotes: 4

Related Questions