1

I'm using the MPAndroidChart library to plot some data from a few sensors. I've found similar questions on SO, but no solutions: Plot Multiple Charts in one in MPAndroidChart MPAndroidChart How to represent multiple dataset object with different number of points in the same chart line

The sensors create data at different rates, and each data sample is stored as data structure like this: .

I would like to be able to plot both sensor values on the same chart as two independent traces. However, after attempting to do this using a LineChart (which claims to be able to plot multiple traces on the same graph) I discovered that the MPAndroidChart Library requires that all data be stored as , with the "xIndex" being an index into a single universal (to the traces on the chart) array of X values.

However, this makes plotting data from non-synchronous sources very difficult.

Is there a way, with MPAndroidChart, to create multiple XY traces with independent axis on both the X and Y axis? That is, can I plot something like this:

trace1 = Array of () trace2 = another array of () trace3...

The only suggestion I saw for a solution was the answer (given by the MPAndroidChart developer) to this question: MPAndroidChart How to represent multiple dataset object with different number of points in the same chart line. However, I'm concerned that using a tag to identify X values will result in slow graphing performance as the dataset grows larger, because I suspect that the library will have to do a lot of string compares and searches to find which Xaxis value corresponds to each Y value.

If it can't be done with MPAndroidChart, can anyone suggest a good library that can do it?

Thanks for any help.

Ammar Tahir
  • 312
  • 4
  • 19
Ron
  • 11
  • 3

1 Answers1

0

ok, in case anyone else runs into this and needs a suggestion...I've found that Android Plot (http://androidplot.com/) meets my needs. It has good native support for XY graphs and seems like a good package all around.

I wish the javaDocs were a little more developed - a lot of functions have no descriptions, just the function declaration. That's not always enough to go off of. But so far it's working well.

Ron
  • 11
  • 3