0

I am trying to add values to a dataset in the Y-Axis but I don't seem to understand how to do that.
I want to add two values, a float and an integer. Below is my code, it works when it was in Java but when I translated to Kotlin, it stopped to work. I am new to Kotlin and doing my first app using MPAndroidCharts.

    //Create an array list of Y-Axis values
    private fun setYAxisValues():ArrayList<Entry> {
        val yVals = ArrayList<Entry>()
        yVals.add(Entry(60, 0))
        yVals.add(Entry(48, 1))
        yVals.add(Entry(70.5f, 2))
        yVals.add(Entry(100, 3))
        yVals.add(Entry(180.9f, 4))
        return yVals
    }
Filnor
  • 1,290
  • 2
  • 23
  • 28
Bruno Jay
  • 1
  • 2

1 Answers1

0

It works. Just add an f to every float value: 60f or 60.toFloat()