XAxis label angle in MPAndroidChart

核能气质少年 提交于 2021-02-18 06:47:13

问题


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?


回答1:


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(...);



回答2:


do it simply by

    XAxis xAxis=barChart.getXAxis();
    xAxis.setLabelRotationAngle(-45);


来源:https://stackoverflow.com/questions/27306962/xaxis-label-angle-in-mpandroidchart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!