Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

376
Vistas
How can I draw dynamic line chart based time and data with Compose in Android Studio?

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

enter image description here

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The library for reference in the Android world regarding plotting is MPAndroidCharts.

That is lib is not "jetpack compose compliant" but jetpack compose allows to use good-old android views by using the AndroidView composable which you may be able to use with a line chart as shown in this example

AndroidView(factory = { ctx ->  
  com.github.mikephil.charting.charts.LineChart(ctx).apply {
    // set properties until it looks like you want it to look like
  }
})

Here's a link to the documentation for the MPAndroidCharts lib

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda