
android - How to format values inside MPAndroidChart ... - Stack …
Have a look at the IValueFormatter interface provided by the library. With that interface, you can completely customize what gets displayed on the chart based on your own logic.
java - MPAndroid Chart , how do i format values on chart from …
Jan 22, 2020 · Use getFormattedValue(float value) instead of getFormattedValue(float value, AxisBase axis) either on LineDataSet or LineData like below: dataSet.setValueFormatter(new ValueFormatter() { @Override public String getFormattedValue(float value) { return String.valueOf((int)value); } }); I have tested on v3.1.0
java - MPAndroidChart Value formatter out of array range - Stack …
Nov 14, 2017 · Basically axis value formatter is called upon selected axis. So if you call it on specific axis it get values of all labels from there and convert them all one by one. – Muhammad Saad Rafique
android - MPAndroidChart x-axis date/time label formatting
Nov 25, 2016 · For some charts in my app, I'm using the MPAndroidChart library. All horizontal axis' of my graphs are time based, they can span a full year, a month, a week, a day or span one hour. It always shows a full period, so January-December, Monday-Sunday, 0:00 - 24:00 etc. The value of the axis is always the epoch-timestamp (in seconds). Requirement
How to set String value of xAxis in MPAndroidChart?
Jul 26, 2017 · According to the new update v3.1.0 IAxisValueFormatter method is deprecated.. So with the use of com.github.mikephil.charting.formatter.IndexAxisValueFormatter we can show month list in x-Axis
How to set the x-axis label with MPAndroidChart
Oct 11, 2016 · You can override AxisValueFormatter. i.e.: xAxis.setValueFormatter(new AxisValueFormatter() { @Override public String getFormattedValue(float value, AxisBase axis) { return "YOUR_TEXT"; // here you can map your values or pass it as empty string } @Override public int getDecimalDigits() { return 0; //show only integer } });
android - MPAndroidChart: How to customise bar value labels
Jan 21, 2017 · Here's a simple formatter that converts all values to integers: public class IntValueFormatter implements IValueFormatter { @Override public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) { return String.valueOf((int) value); } }
How to set X axis labels in MP Android Chart (Bar Graph)?
Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers; Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand
java - MPAndroidChart setValueFormatter requires ValueFormater …
Nov 15, 2020 · private class MyAxisFormatter implements IAxisValueFormatter { @Override public String getFormattedValue(float value, AxisBase axis) { return value as an hour; } } I used. private class MyAxisFormatter extends ValueFormatter { @Override public String getFormattedValue(float value) { return "someValue"; } }
java - Setting string values as xaxis labels of an MPAndroidChart …
Oct 7, 2020 · What you need to do is convert your floating point values to integer using Math.round() this will ensure that the checks evaluate to true accurately since as at now they are only evaluating to true at 7.0 since that is equal to 7 while the rest are evaluating to false even when it should be true your formatting code should thus be