I am using MpAndroidChart and it is going very well except for one problem. When I zoom in on a specific region of the graph, the X values appear multiple times in a clumped manner. I override the X axis setValueFormatter
(code below along with some pictures) to display dates returned from inputted data. Has anyone had this happen to them, and if so, do you know the cause of it? I am considering just disabling the zoomable option, but I would prefer to have it. Thank You!
bottomAxis.setValueFormatter(new AxisValueFormatter() {
@Override
public String getFormattedValue(float value, AxisBase axis) {
// return values will all be the values of the dates array
int value_i = (int) value;
if (value_i % 2 == 0 && (value_i / 2) <= epochs.length && value_i >= 2) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(eu.getDailyInfo().getEpochValues()[(value_i/2)-1]);
return (assignMonth(calendar.get(Calendar.MONTH)) + "" + String.valueOf(calendar.get(Calendar.DAY_OF_MONTH)));
} else {
return "";
}
}
@Override
public int getDecimalDigits() {
return 0;
}
});