Multi-Line Graphs

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).

Member for

16 years 10 months

brett

15 years 1 month ago

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

Member for

15 years 3 months

EJ-Ambient

15 years 1 month ago

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

Member for

16 years 10 months

brett

15 years 1 month ago

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

Member for

15 years 3 months

EJ-Ambient

15 years 1 month ago

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

Member for

15 years 3 months

EJ-Ambient

14 years 10 months ago

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&heig…

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

Member for

15 years 3 months

EJ-Ambient

14 years 10 months ago

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