I am using mp chart library for android and want that my maximum draw value to be on top of line and min draw value to be above the line

Viewed 22

It wiil be great also to put margin there. I am attaching also 2 sc .enter image description here

enter image description here

1 Answers

Find the minValue and maxValue then the set the axisMin and axisMax values.

//use getAxisRight for right Y axis
YAxis leftAxis = lineChart.getAxisLeft();
leftAxis.setAxisMinimum(minValue);

//above line would be the same except
//"1" should be calculated and not hard coded
leftAxis.setAxisMaximum(maxValue - 1);

Related