I have values like integer
or date
value but don't know where to use them in Android.
So that when I zoom in the values remain at the same place and between the values there is an empty space.
I want to show the values between them like [1 2 3] on graph only showing values 1,2,3 but not showing like 1,1.1,1.2,1.3 ... 2.8 2.9(when zooming in)?
final ArrayList<String> xLabel = new ArrayList<>();
xLabel.add("1");
xLabel.add("2");
xLabel.add("3");
xLabel.add("4");
xLabel.add("5");
xLabel.add("6");
XAxis xAxis = line.getXAxis();
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setDrawGridLines(false);
xAxis.setGranularity(1f); // only intervals of 1 day
xAxis.setValueFormatter(xAxisFormatter);
xAxis.setValueFormatter(new IAxisValueFormatter() {
@Override
public String getFormattedValue(float value, AxisBase axis) {
return xLabel.get((int)value);
}
});