'how to add string value in BarEntry mikephil.charting.charts.barchart For input string: "[2022/01/26, 2022/01/26, 2022/01/26]" Barchart

I use barchart , I convert string value into float by .float() but it did not work
java.lang.NumberFormatException: For input string: "[2022/01/26, 2022/01/26, 2022/01/26]"

private fun barchart(root: View?) {   
        val bar: BarChart = root!!.findViewById(R.id.bar_chart)
        val id = reportViewModel.getallid()
        val days = reportViewModel.getalldays()
        val total = reportViewModel.getall_total()
        val item: ArrayList<BarEntry> = ArrayList()
        val v=0
        item.add(BarEntry(days.toString().toFloat(),total.toString().toFloat()))
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source