Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MPAndroidChart - How to set description in another position?

I'm using MPAndroidChart library.

Is possible to place the position of the description of the chart in another position than in the bottom right corner of the chart?

I just have a BarChart where some bars on the right are zero and are in the same position as the description.

enter image description here

like image 634
mlozdev Avatar asked Dec 14 '22 16:12

mlozdev


1 Answers

v2 and lower:

You can either hide the description by calling

chart.setDescription("");

or modify the position of the description by calling

chart.setDescriptionPosition(float xpos, float ypos)

v3.0.0+ release:

mChart.getDescription().setText("X-Axis:  Date\\nY-Axis:Output ");
mChart.getDescription().setPosition(3f,3f);

Here, you can find the official documentation for the Description.

like image 105
Philipp Jahoda Avatar answered Jan 09 '23 11:01

Philipp Jahoda