Reputation: 131
I am using MPAndroidChart. I need to hide value label put above bar on my BarChart. How can i do this?
Upvotes: 6
Views: 3588
Reputation: 51421
Yes, there is a way.
Just call
dataSet.setDrawValues(false);
Upvotes: 16
Reputation: 92
Line 316 is where the label is drawn. So you can comment that out in your library. It's easy to do if you're using the actual library as a library but if you're just using it as a dependency in your gradle file or using a jar file I'm not sure if you can't easily hide it.
Look at Line 176 of that file. That's where the drawing label starts.
You can change the position of the label based on this variable drawValueAboveBar which I think you can set easily.
The other thing you can do is make the paint it's using the draw's color TRANSPARENT.
use the mValuePaint.setColor() method and set its color to transparent.
Upvotes: -1