val graph = findViewById(R.id.graph) as GraphView
val series = LineGraphSeries(arrayOf(
DataPoint(0, 1),
DataPoint(1, 5),
DataPoint(2, 3),
DataPoint(3, 2),
DataPoint(4, 6)
)
)
graph.addSeries(series)
но вы можете заказать его как
val graph: GraphView = findViewById(R.id.graph)
graph.addSeries(LineGraphSeries(arrayOf(
DataPoint(0, 1),
DataPoint(1, 5),
DataPoint(2, 3),
DataPoint(3, 2),
DataPoint(4, 6)
)
))