0

Is there any efficient way of doing this? My screenshot from Android device

As for now I am reading accelerometer data (all graphs are moving to the left edge of screen) and compare them with my black threshold.

When new accelerometer single data arrives, I plot all three values (red,blue,black). This means adding three new points to the correspondent series at the end and removing the first point from series (to enable 'movement').

Is there an option to avoid adding new points to the black graph (threshold) to make it plot in an efficient manner? Or maybe this is quite efficient option, huh?

Michał Dobi Dobrzański
  • 1,449
  • 1
  • 20
  • 19

1 Answers1

0

There are many options to do graphing. If you want static graphing you can use these API's/code samples.

AChartEngine

Simple Line Chart

Draw a Graph

Charts4j

AndroidPlot - one of the best looking ones, does dynamic plots too and is now open sourced.

TeeChart

So many others to choose from but most are static and non of these can handle real time data plots, i.e. ECG wave forms. One example you might want to look at is the Tricorder android example. Problem it is really complex to setup and if you just want the graphs, there is so much code to rip out. It can be done but I even noticed there is a lag the longer you run the program.

So far the only way I have found a real good dynamic graphing, is to do it yourself and use the SurfaceView and then draw usin the path.lineTo() see below for previous SO answer for this solution.

SO example:

Community
  • 1
  • 1
OBX
  • 6,044
  • 7
  • 33
  • 77