0

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?

jww
  • 97,681
  • 90
  • 411
  • 885
jwhitmore
  • 203
  • 1
  • 2
  • 8

1 Answers1

1

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.

BrentM
  • 5,671
  • 3
  • 31
  • 38
  • I was looking at AndroidPlot but unlike graphview I was struggling to find [API Documentation](http://jjoe64.github.io/GraphView/javadoc/). Having said that looking at that App it's perfect! Have to find code or docs. – jwhitmore Feb 04 '15 at 22:49
  • Found it! [sensor data](http://androidplot.com/docs/dynamically-plotting-sensor-data/) thanks a million for your answer. I was looking at githib sight and there was no link to documentation. Google kept directing me there. – jwhitmore Feb 04 '15 at 22:56