You can use the LimitLine
class to acheive this.
Basically, that class allows you to draw a customizeable line to a specified position on the y-axis in the chart and add a description to it.
After creating the line, you need to assign it to an XAxis
or YAxis
.
For more details, have a look at the documentation. You can find limitlines it on the bottom of the page.
Also, this example class shows how to use them: https://github.com/PhilJay/MPAndroidChart/blob/master/MPChartExample/src/com/xxmassdeveloper/mpchartexample/LineChartActivity1.java
UPDATE: Now LimitLines can be assigned to any axis!