New to Android and Android Plot

57 views
Skip to first unread message

remu...@gmail.com

unread,
Feb 16, 2017, 6:46:35 PM2/16/17
to Androidplot
Hi All,

New here and new to android in general. First of all, let me say that Android Plot looks like an awesome library. Thank you all for developing this.

Can you please point me to an example of a plot using
FixedSizeEditableXYSeries?

I am developing an app that collects sensor data and would like to put this data in a streaming plot of a fixed size. This looks like the right series to use.

Thanks


Nick

unread,
Feb 16, 2017, 8:35:15 PM2/16/17
to Androidplot
Hey Remus,

That sounds like a good use case for FixedSizeEditableXYSeries, assuming you're looking for an ECG style presentation of your data.  ECGExample provides a working sample of such a plot, but it doesn't currently use a FixedSizeEditableXYSeries. It probably should, but was written before FixedSizeEditableXYSeries was created and has not been refactored yet.   Instead it uses a custom implementation of XYSeries that essentially does the same thing - you won't have much trouble using ECGExample as a starting point and working in FixedSizeEditableXYSeries  for what you're trying to do.

If you run into any additional issues, if you don't mind please post a question to Stack Overflow using the Androidplot tag.  (This forum only still exists to host topics that SOF prohibits, ie. those of a non-technical or subjective nature)

Cheers!
Nick

remu...@gmail.com

unread,
Feb 17, 2017, 1:46:03 PM2/17/17
to Androidplot
Hi Nick,

Thanks for your reply. I will post from now on in SOF. Im responding here since we have a conversation started. Im sure that what youre saying is eazy, but like I said, im very new at this. Can you help me just a little bit more. Here is what I have:

// now put in some data
hrHistory = new FixedSizeEditableXYSeries("Heart Rate",10);

xyPlot.addSeries(hrHistory, new LineAndPointFormatter(Color.GREEN,Color.RED,null,null));

Now I thought, based on the github library that I should be able to do something like

hrHistory.setX("new value") but the object hrHistory does not have a method setX. It only has getX getY, and size as far as I can tell.

I also cant seem to push values into series like this: hrHistory("newvalue") or hrHistory["new value").

So how do I add new values to this series?

Nick

unread,
Feb 17, 2017, 1:56:12 PM2/17/17
to Androidplot
Hey Remus,

You're probably defining hrHistory like this:

XYSeries hrHistory = new FixedSize...

Which means you'll be limited to calling methods defined in the XYSeries interface.  If you change to:


FixedSizeXYSeries hrHistory = new FixedSize...

Then you'll be able to call the setX(...) and setY(...) methods defined in FixedSizXYSeries.

In any case, I've replied to your SOF post.  If you update your SOF question with your code above we can continue the conversation there.
Reply all
Reply to author
Forward
0 new messages