I use the compile 'com.github.PhilJay:MPAndroidChart:v3.0.2' library compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'
How to make the data output integer without a comma.
// in this example, a LineChart is initialized from xml BarChart chart = (BarChart) view.findViewById(R.id.chart); List<BarEntry> entries = new ArrayList<>(); entries.add(new BarEntry(0, 30)); entries.add(new BarEntry(1, 80)); entries.add(new BarEntry(2, 60)); entries.add(new BarEntry(3, 50)); entries.add(new BarEntry(4, 70)); entries.add(new BarEntry(5, 60)); entries.add(new BarEntry(6, 60)); entries.add(new BarEntry(7, 60)); entries.add(new BarEntry(8, 60)); entries.add(new BarEntry(9, 60)); BarDataSet set = new BarDataSet(entries, "BarDataSet"); set.setColor(Color.parseColor("#FF8000")); chart.setDrawValueAboveBar(true); BarData data = new BarData(set); data.setBarWidth(0.8f); // set custom bar width chart.setData(data); chart.setFitBars(true); // make the x-axis fit exactly all bars chart.invalidate(); // refresh String[] values = new String[] {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"}; XAxis xAxis = chart.getXAxis(); xAxis.setValueFormatter(new MyXAxisValueFormatter(values)); xAxis.setGranularity(1); xAxis.setGranularityEnabled(true); xAxis.setLabelCount(10); chart.getXAxis().setPosition(XAxis.XAxisPosition.BOTTOM); return view; } public static Fragment_infografika_lvl newInstance() { return new Fragment_infografika_lvl(); } public class MyXAxisValueFormatter implements IAxisValueFormatter { private String[] mValues; public MyXAxisValueFormatter(String[] values) { this.mValues = values; } @Override public String getFormattedValue(float value, AxisBase axis) { // "value" represents the position of the label on the axis (x or y) return mValues[(int) value]; } } 