As of MPAndroidChart 3.0.1 this is currently not possible using the API exposed by the library. You will need to add additional TextView outside the chart, or modify the library to your purpose.
If you want to modify the library to your own purpose, you will need to study the source code XAxisRenderer and subclass it to add functionality to draw the axis label you want.
mChart.getAxisLeft().setEnabled(true); //show y-axis at left
mChart.getAxisRight().setEnabled(false); //hide y-axis at right
mChart.getAxisLeft().setValueFormatter(new IAxisValueFormatter() {
@Override
public String getFormattedValue(float value, AxisBase axis) {
return "string_" + (int) value; // yVal is a string array
}
});
(Turning @Ironman's comment into an answer:)
As of MPAndroidChart 3.0.1 this is currently not possible using the API exposed by the library. You will need to add additional
TextView
outside the chart, or modify the library to your purpose.If you want to modify the library to your own purpose, you will need to study the source code
XAxisRenderer
and subclass it to add functionality to draw the axis label you want.You can apply this code