Multi-Line Graphs

9 replies [Last post]
EJ-Ambient
Offline
Ringwood, United Kingdom
Joined: 5 Aug 2011

Hi all

I've recently joined the HAH community and I'm getting great satisfaction from seeing the stuff work as advertised....  I'm not a Linux/C/XaP/LUA kinda guy - but I can follow detailed instructions...which is what is usually provided...and I've succefully hacked/modded several LiveBox's and have them actively uploading data from my SolarPV array to Pachube feeds (see https://pachube.com/feeds/37125 for my real-time graphs).

However - I'd like to have the capability of viewing all my data from the various Feed:ID's on one graph - this would be far more meaningful, and much easier to interpret - so my question is:

What do I need to do to get the data from several CurrentCost channels onto one graph?

Pachube tell me that they do not provide this service - but they are working on something similar and will have a beta version 'real soon' - possibly!!

I see that HAH provide graphing capability - could it be incorporated there?  Oh! the possibilities!!!!

Thanks for looking at this - I hope someone can come up with something!

Regards

 

EJ

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Options.

Yes you can but if you are not a Linux/xAP kind of guy this might be out of your league too.

http://www.dbzoo.com/livebox/xap_cacti

I do recall messing around with google graph and using some javascript to slurp out the Pachube data but alas I dont' think I have the sample code that I wrote.

Brett

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Actually pachube can do that....

Check that out -> http://apps.pachube.com/google_viz/preview_multi.php

EJ-Ambient
Offline
Ringwood, United Kingdom
Joined: 5 Aug 2011
That's pretty much it!!!

Hi Brett

Thanks for taking a look - and what you've come up with pretty much fits the bill - and you say its from Pachube (I can see the Pachube splash - so why don't they know it can be done?)...

Can you run through what you did to get the graph, please....even if it is Linux/C based I'll have a good try..

Thank again...hope to hear from you soon.

(Also looking at CACTI as you suggested - but if the above works, then it'll be the way I'd prefer to go)

Elliot

brett
Offline
Providence, United States
Joined: 9 Jan 2010
say what?

I'm confused by your request - if you clicked on the link I supplied you'll see the HTML that you can embed on some web page of your's to generate those combined graphs.   A snippet I've reproduced here.

This snippet of HTML would graphs G7PKF's data stream https://pachube.com/feeds/15114 - House, Solar and Grid, as Red, Blue, Green on the same graph.  You would need to put this onto your  webpage somewhere.... assuming you have one.

If not just cut/past it into a FILE with the extension .html and then double click on it.  ie: crapbags.html  or whatever.  :)

<script type="text/javascript" src="http://www.google.com/jsapi"></script><script language="JavaScript" src="http://apps.pachube.com/google_viz/viz_multi.js"></script><script language="JavaScript">createViz([15114,15114,15114],[0,1,2],800,400,["ff0000","0000ff","00ff00"]);</script>

This syntax also allows you to graph multiple feeds to the same graph too.  I've have sourced all the data from a single feed in this case 15114, and used Streams 0,1,2

Brett

EJ-Ambient
Offline
Ringwood, United Kingdom
Joined: 5 Aug 2011
Seek and ye shall find!

Thanks Brett

I was so keen on moving the slider and playing with the graph I completely missed your 'USE THIS BIT' text at the bottom of the screen.... all sorted now, and thanks again!

I've modded your snippet and I can now easily compare all the feedIDs I want - oh happy days!

I see it uses google_viz - I'll see what I can find in the way of manuals/help files, or can you suggest a url?  I'd like to get the time set to timezone=London and the display to default to the last 5 days.

Many thanks for this...

cheers

Elliot

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
Think i should charge you for using my feed's :)

:0

 

only Joking....feel free to produce more for my feeds as long as you share them :)

EJ-Ambient
Offline
Ringwood, United Kingdom
Joined: 5 Aug 2011
Slightly different graph request

Hi Brett

Thanks very much for your input - it was most helpful and it got me off to a great start.....however, now that i'm back (long convalescence and family health issues) I'd like to progress this some more...

I've been using the .png graphs (tweaked) from Pachube to get 2 or 3 hours worth of data as:-

https://api.pachube.com/v2/feeds/34982/datastreams/1.png?width=500&heigh...

This works great - but it only puts one datastream onto the graph, is there any way that datastreams 2 and 3 can be added/overlaid onto the graph for datasteam 1?

Alternatively is there any way of (easily) making the graphs semi-transparent and stacking them on top of each other?

hope you can help.....thanks in advance

EJ

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Multiple datastreams on a pachube graph

EJ yes you can do this did you look at the example on this thread a few posts back?

Brett

EJ-Ambient
Offline
Ringwood, United Kingdom
Joined: 5 Aug 2011
Slightly different graph request

Hi Brett

Thanks for the reply - yes I've already got the snippet working, I'm looking for a way of getting a quicker graphical response from the Pachube data.... the latest incarnation of the javascript takes upto 20 seconds to refresh and downloads (upto) 30 days data but only updates every 2 hours.... the 1.png graph I posted earlier only downloads 2hours of data and is much more responsive (less than 1/2 second), which is what I'm after....

So - is there a way the javascript can be tweaked to only download the 2 or 3 hours worth of data or is there a way to overlay 2 or 3 of the 1.png type graphs

hope you can have a look, ta!

EJ

Hardware Info