I'm using MPAndroidChart to display a Bar chart in my android app. But xAxis labels and bars are not aligned.
I used MPAndroidChart:v3.0.3. In the screenshot, bars are not aligned with labels. I follow the git example. Tried some solution but nothing actually works. Can't identify the problem. The bar width is .5f
chart setup
barChart.setDrawBarShadow(false);
barChart.setDrawValueAboveBar(true);
barChart.getDescription().setEnabled(false);
barChart.setMaxVisibleValueCount(60);
barChart.setPinchZoom(false);
barChart.setScaleEnabled(false);
barChart.setDrawGridBackground(false);
barChart.setFitBars(true);
barChart.animateY(2500);
xAxis setup
XAxis xAxis = barChart.getXAxis();
xAxis.setSpaceMax(0.5f);
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setDrawAxisLine(true);
xAxis.setCenterAxisLabels(false);
xAxis.setGranularity(1f);
xAxis.setAxisMinimum(0f);
xAxis.setAxisMaximum(xAxisKeys.size());
xAxis.setLabelCount(xAxisKeys.size(), true);
IAxisValueFormatter xAxisFormatter = new CustomFormatter(xAxisKeys);
xAxis.setValueFormatter(xAxisFormatter);
