Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XAxis label angle in MPAndroidChart

I am using MPAndroidChart library for my project. Is it possible to rotate the labels of the XAxis by 270 degrees so that I can fit more text?

like image 311
Kyaw Avatar asked Dec 05 '14 00:12

Kyaw


2 Answers

Original answer:

Unfortunately it is currently not possible to rotate the values on the x-axis of a chart to a certain degree / angle. You will have to implement such a feature yourself.

UPDATE:

As of v2.1.5 this feature is now available:

 XAxis xAxis = chart.getXAxis();
 xAxis.setLabelRotationAngle(...);
like image 98
Philipp Jahoda Avatar answered Nov 01 '22 17:11

Philipp Jahoda


do it simply by

    XAxis xAxis=barChart.getXAxis();
    xAxis.setLabelRotationAngle(-45);
like image 3
Rahul M Mohan Avatar answered Nov 01 '22 16:11

Rahul M Mohan