jwhitmore
jwhitmore

Reputation: 203

Draw a line graph with constantly updating data?

I'm trying to use Android Graph view to draw two line graphs, that's not a problem but unfortunately one of the line graphs is dynamically reading data from a hardware sensor. That does appear to be a problem as GraphView uses fixed length arrays. Which are difficult to add new data to.

To be more specific I've got a waveform which is fixed and I know all the data points. In sort of real time I'm receiving a temperature reading every Second. I wanted to add more and more data to a second line graph and watch it "grow" and hopefully follow the fixed "target" waveform, or a close approximation to it.

What's the best way to handle this "dynamic" data in GraphView. I don't think that destroying a Fixed duration Array every second, increasing its size and repopulating it from an ArrayList, which I can add values to on the fly.

Perhaps there is a better alternative?

Upvotes: 0

Views: 1755

Answers (1)

BrentM
BrentM

Reputation: 5757

An alternative to GraphView is AndroidPlot. It supports real time data in a line chart. There is a sample app in the play store. Take a look at the Real time orientation plot example in the app.

Upvotes: 1

Related Questions