GroveStreams

Chart with X-axis spaced according to timestamp, not equal spacing535

Nahanni private msg quote post Address this user
Hi,
Sorry, newbie question. Setup an organization for some of my Smartthings data, following this quickstart guide: clickable text

Happily, I get data on temperature sensors and contact closures. But, when I plot the data with a "Line Chart" (only reasonable option), I find the data is always equally spaced, despite events being randomly timed. How do I get correctly spaced X-axis? I see lots of beautiful examples of how this being done in FAQ, but can't determine how. It's sorta like plotting in Xcel line chart vs. Scatterplot...scatterplot is what I want. Tnx!

PS. I'm getting lots of errors in my Smartthings log, those seem to be random, but I'm assuming that's not related to this question...but maybe not? "groovyx.net.http.ResponseParseException: OK @line 71 (sendValue)"
Post 1 IP   flag post
MikeMills private msg quote post Address this user
I think you need to fill the spaces between with time/values to get what you're after.

I'm guessing you're graphing a Regular stream. You could graph an Interval stream to fill all of those missing times. An interval stream has a value for all time intervals. Your in-between intervals will be null since there is no actual value.

Your stream definition has a default rollup calendar. It's cycle intervals will show in the line chart dashboard widget - Settings - Data Tab - Cycle column. Choose a cycle there and an Interval stream, based off of your stream will be used. While you have that stream selected on the Data tab, try changing the "Connect Gaps" setting to just see a dot.

When you select a cycle, a virtual Interval stream based off of your stream is used. If you choose an Hour interval stream, the statistic will determine how to handle situations if more than one sample falls within that hour (i.e. SUM them, use MAX, use the Avg, use the LAST, ...). So consider that some of your Intervals might have more than one sample in them and choose the statistic that makes sense.
Post 2 IP   flag post
3015 2 2
Log in or sign up to compose a reply.