0

Earlier, we could set label for X-Axis using the constructor of LineData.

            LineData lineData = new LineData(labels,dataSet);

But after 3.0, it's not working. Has this been removed or am i missing something?

div
  • 1,475
  • 3
  • 22
  • 32

2 Answers2

0

You can use value formatters . xAxis.setValueFormatter(new AxisFormatter)

Muhib Pirani
  • 765
  • 1
  • 6
  • 15
0
xAxis.setValueFormatter(new AxisValueFormatter() {
            @Override
            public String getFormattedValue(float value, AxisBase axis) {
// here you can return whatever you want,
// for example you can return values from array, and use value argument as index
                return labels[value]);
            }

            @Override
            public int getDecimalDigits() {
                return 0;
            }
        });
Dmitrijs
  • 1,333
  • 1
  • 14
  • 20