How to add String Label to MPAndroidCharts

2019-08-14 16:48发布

问题:

I am developing a simple Android app which shows a dataset of flot numbers on a linechart. I am using MPAndroidChart and thanks to it I am able to manage my custom linechart and its style.

However, I am trying to add a String Label in order to label both the domain (x-axes) and the range (y-axes) of my linechart, as shown in the picture below.

Any suggestions to do it using MPAndroidChart?

回答1:

Actually, what I need it is not supported by the MPAndroidChart. Hence the only way to do that is to define two TextView for domain and range label respectively. Moreover, in order to have the range label as shown in the above figure I suggest to see this question which explain how to design a vertical TextView. It works for me.