android - How to use setLabelCount(...) in MPAndroidChart? -
i using mpandroidchart library.
i have used barchart.getaxisleft().setlabelcount(5);
, returns labels 0.00, 20.00, 40.00, 60.00
want 0.00, 25.00, 50.00, 75.00, 100.00
.
i want show 100 also. there possibilities?
update
i have added following lines,
barchart.getaxisleft().setaxismaxvalue(100); barchart.getaxisleft().setaxisminvalue(0); barchart.getaxisleft().setlabelcount(5);
now output is
0.0, 20.0, 40.0, 60.0, 80.0, 100.0
so changed following,
barchart.getaxisleft().setaxismaxvalue(100); barchart.getaxisleft().setaxisminvalue(0); barchart.getaxisleft().setlabelcount(4);
now output
0.0, 30.0, 60.0, 90.0
but need following output.
0.0, 25.0, 50.0, 75.0, 100.0
any highly appreciated.
may set custom y axis value via valueformatter
. such as:
public class customvalueformatter implements valueformatter { public customvalueformatter() { } @override public string getformattedvalue(float value) { return (value/20)*25 + " "; // transfer number meet want. } }
Comments
Post a Comment