Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I set units in MPAndroidChart?

enter image description here

I want to adjust the unit spacing of the red borders in the photo For example, I want to adjust the units in 70 steps like 70,140,210. Is this possible? Thank you

like image 645
leegill Avatar asked Dec 13 '25 13:12

leegill


1 Answers

try to this

tempLineChart = findViewById(R.id.temp_lineChart);
YAxis yAxisleft = tempLineChart.getAxisLeft();
yAxisleft.setValueFormatter(new ValueFormatter() {
        @Override
        public String getFormattedValue(float value) {

            return value+"℃";
        }
    });

enter image description here

like image 57
Eren Avatar answered Dec 16 '25 09:12

Eren



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!