I am using MPAndroidChart library. Anybody has this problem? When I put the labels in BOTTOM position, these are cut.
Thank you
They are cut because your text is too long and the library does not support "wrapping" of the labels to a new line.
You will either have to shorten your legend labels or implement the desired functionality yourself.
UPDATE:
Word wrapping for the Legend
is now supported.
chart.getLegend().setWordWrapEnabled(true);
Here I will show you an easy way by "Traditional Android Way", it's quite simple, my code is below:
<LinearLayout
android:id="@+id/i_am_chart_view_container"
...
android:paddingRight="20dp"
android:clipChildren="false"
android:clipToPadding="false"
.../>
Just need to add some padding
to the container layout, or some margin
to the chart view, and finally set clipChildren
&clipToPadding
to false.
Result below:
the blue area is padding or margin area.
After a long research, I found the solution. The below code solved it.
chart.getLegend().setWordWrapEnabled(true);