MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

Legend position deprecated

Open araviel opened this issue 9 years ago • 4 comments

Hi, before all, thanks for this wonderful api !

But i'm wondering after a lot of searches in stackoverflow and the documentation i can't find an updated guide for positionning legend in my PieChart.

Can someone tells me how to put the legend horizontally or vertically but aligned to the right of the charts ?

Thank in advance !

araviel avatar Sep 27 '17 16:09 araviel

Any body?

laxmimerit avatar Apr 03 '18 04:04 laxmimerit

According to the documentation of Legend#getPosition(): LegendPosition, Legend#setPosition(LegendPosition):

This property is deprecated - Use horizontalAlignment, verticalAlignment, orientation, drawInside, direction.

Have you tried those?

MGaetan89 avatar Apr 03 '18 05:04 MGaetan89

Yeah it's working but it telling that setPosition() is deprecated. However, It is working fine as of now but wanted to know new method

laxmimerit avatar Apr 03 '18 06:04 laxmimerit

legend.setVerticalAlignment(Legend.LegendVerticalAlignment.CENTER); legend.setHorizontalAlignment(Legend.LegendHorizontalAlignment.RIGHT); legend.setOrientation(Legend.LegendOrientation.VERTICAL);

Try this code. Thanks

afinas-em avatar Apr 10 '18 09:04 afinas-em