https://kotlinlang.org logo
i

Irene Serrano

06/16/2021, 8:40 PM
Hello, If anyone is familiar with using AChartEngine in their android projects, I would appreciate your help in trying to get a line of code to work. I am currently following this tutorial and I am stuck on the part wherein we create the View. I don't really know how to change this line to Kotlin and if I just pasted the line as is (in Java), Android Studio does not offer to translate the code for me. Any advice would be helpful, let me know if more information is needed
🙌 1
c

CLOVIS

06/16/2021, 9:25 PM
What's the line that you're stuck with?
i

Irene Serrano

06/16/2021, 9:27 PM
GraphicalView chartView = ChartFactory.getLineChartView(getActivity(), dataset, mRenderer);
c

CLOVIS

06/17/2021, 7:58 AM
val chartView = ChartFactory.getLineChartView(getActivity(), dataset, mRenderer)
is the correct Kotlin syntax (you might need imports)