Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MPAndroidChart: Rotate Labels of X-Axis by 90 degrees in BarChart

My text in xAxes of BarChart from MPAndroidChart is too long. How I can rotate label of xAxes by 90 degrees?

like image 216
mbagher Avatar asked Aug 10 '15 02:08

mbagher


2 Answers

Now it is possible in library version 2.1.6

try this

XAxis xAxis=barChart.getXAxis();
xAxis.setLabelRotationAngle(-45); 
like image 94
Hardik Amal Avatar answered Nov 16 '22 04:11

Hardik Amal


It is simple, try this...

XAxis xAxis = barChart.getXAxis();
xAxis.setLabelRotationAngle(90); 
like image 21
Gurvinder Singh Avatar answered Nov 16 '22 04:11

Gurvinder Singh