I am using MPAndroidChart library. I want customize legends in MPAndroidChart. In MPAndroidChart library i tried to set the position of legends. by given code legend.setPosition(LegendPosition.BELOW_CHART_CENTER) but unable to do it. I have to set legends as shown in following image
help will be appreciate
In your case I would recommend that you disable the Legend
that is drawn by the chart and instead come up with your own implementation.
chart.getLegend().setEnabled(false)
In the case shown above you will probably need a ListView
that takes data from the charts Legend
object and displays it.
When you have a look at the Legend class you will notice that it has member variables for colors and labels.
You can retrieve those arrays (getColors()
, getLegendLabels()
) and use them to be displayed in the ListView
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With