title: Int values on BarChart
body: <p>I want the values on my bar chart to be integers. I only managed to find out how to modify the values represented on the axes with ValueFormatter, but this didn't affect the values on the chart. Here's what I currently have:</p>
  
  <p><a href="https://i.stack.imgur.com/JqVuP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JqVuP.jpg" alt="enter image description here"></a></p>
  
  <p>And here's my code:</p>
  
  <pre><code>HorizontalBarChart barChart = findViewById(R.id.bar_chart);
  
      ArrayList&lt;BarEntry&gt; yValues = new ArrayList&lt;&gt;();
      SharedPreferences appData = getSharedPreferences("app_data", Context.MODE_PRIVATE);
      String[] supermarkets = new String[appData.getAll().size()];
      int i = 0;
      for (Map.Entry&lt;String, ?&gt; entry : appData.getAll().entrySet()) {
          int value = (Integer)entry.getValue();
          BarEntry e = new BarEntry(i, value, 3);
          yValues.add(e);
          supermarkets[i] = entry.getKey();
          i++;
      }
  
      BarDataSet dataSet = new BarDataSet(yValues, "Supermarkets");
      dataSet.setColors(ColorTemplate.COLORFUL_COLORS);
      BarData data = new BarData(dataSet);
  
      barChart.getXAxis().setDrawGridLines(false);
      barChart.getXAxis().setDrawAxisLine(false);
  
      barChart.getAxisLeft().setDrawGridLines(false);
      barChart.getAxisRight().setEnabled(false);
      barChart.getAxisLeft().setEnabled(false);
  
      barChart.getAxisRight().setDrawGridLines(false);
      barChart.getAxisLeft().setAxisMinimum(0);
      barChart.getAxisRight().setAxisMinimum(0);
  
      barChart.getXAxis().setValueFormatter(new LabelFormatter(supermarkets));
      barChart.getXAxis().setGranularity(1);
      barChart.getXAxis().setPosition(XAxis.XAxisPosition.BOTTOM);
  
      barChart.setData(data);
  
  public class LabelFormatter implements IAxisValueFormatter {
      private final String[] mLabels;
  
      LabelFormatter(String[] labels) {
          mLabels = labels;
      }
  
      @Override
      public String getFormattedValue(float value, AxisBase axis) {
          return mLabels[(int) value];
      }
  }
  </code></pre>