The Code A generate continuous datas whom's range is 0 and 100. I hope to draw dynamic line chart based time and data.
The X axis is time (The initial range is 0 and 1 minutes, and it can be increased by time) , and Y axis is data (The range is 0 and 100).
I hope to draw dynamic line chart in the coordinate system.
It's just like Image A.
How can I do? Is there sample code ?
Code A
private fun soundDbFlow() = flow {
while (true) {
val data=(0..100).random().toDouble()
emit(data)
delay(100)
}
}
Image A
