Page 1 of 1

[Module] Graph Editor

Posted: Sun Jan 17, 2010 10:57 am
by Minus
Hi,

I start to write a "Graph Editor"
The goal of this peace of code is to make the more flexible as possible rrdgraph printing.
  • Change color (graph, background, shade...)
    Multi graph
A first screenshot to give a first preview:
GraphEditor.png
GraphEditor.png (22.24 KiB) Viewed 9179 times
Example of rrdgraph print:
frigo-temp-1d.png
frigo-temp-1d.png (10.16 KiB) Viewed 9179 times
More spec will be arrive soon.
I hope not to be in the same scope as one of your current dev :roll:

Re: [Module] Graph Editor

Posted: Sun Jan 17, 2010 8:12 pm
by RDNZL
Very nice and good idea.
Never got around making multi-graphing work.

The development version is changing/growing fast, but in other areas, so keep on working on it, and if you're ready I will integrate it.

Thanks!

Re: [Module] Graph Editor

Posted: Thu Sep 16, 2010 6:16 pm
by hhg
Hi Ron/Minus

Is this module/code available some where? It looks nice!

Best regards
hhg

Re: [Module] Graph Editor

Posted: Thu Sep 16, 2010 8:59 pm
by Minus
I 've added loads of fuctions and redesign the code.

This first version (0.0001) is working but some functions have to be redesign.

I'm actually working on this (during my free time :roll: )
Graph_Editor.jpg
Graph_Editor.jpg (84.07 KiB) Viewed 9130 times

Re: [Module] Graph Editor

Posted: Fri Sep 17, 2010 12:12 am
by j.hoekstra
Very nice :)
Look forward to seeing it added in the main repo :)

Re: [Module] Graph Editor

Posted: Fri Sep 17, 2010 8:50 am
by RDNZL
Thanks.

Funny to see that all of a sudden users start mailing their code contributions to DomotiGa at the same time within 2-3 days... :wink:
I'll see what I can do...

Re: [Module] Graph Editor

Posted: Fri Sep 17, 2010 8:33 pm
by RDNZL
Minus wrote: I 've added loads of functions and redesign the code.
This first version (0.0001) is working but some functions have to be redesign.
Hi Minus, I have added your work to version 0.1.187.

Cleaned up code.
Fixed spelling errors widht -> width (db table name)
Store original device name in Combo, make lowercase DSname in other routine (otherwise devices with capitals are not found)
Sort combolist entries for easier searching.
Add period selection to preview window.
Todo: Move graph generate code to a module so DomotiGaServer can generate graphs too. (for example if a xmlrpc call requests that)
Bug left: ERROR: Cannot parse vname from 'DEF:www.google.com_rtt=/home/ron/domotiga/rrd/www.google.com.rrd:rtt:AVERAGE'
I also moved some fields and buttons around in the GUI, hope you don't mind.
Thanks again for your work!

Re: [Module] Graph Editor

Posted: Fri Sep 17, 2010 10:11 pm
by Minus
RDNZL wrote:
Minus wrote: I 've added loads of functions and redesign the code.
This first version (0.0001) is working but some functions have to be redesign.
Hi Minus, I have added your work to version 0.1.187.

Cleaned up code.
Fixed spelling errors widht -> width (db table name)
Store original device name in Combo, make lowercase DSname in other routine (otherwise devices with capitals are not found)
Sort combolist entries for easier searching.
Add period selection to preview window.
Todo: Move graph generate code to a module so DomotiGaServer can generate graphs too. (for example if a xmlrpc call requests that)
Bug left: ERROR: Cannot parse vname from 'DEF:www.google.com_rtt=/home/ron/domotiga/rrd/www.google.com.rrd:rtt:AVERAGE'
I also moved some fields and buttons around in the GUI, hope you don't mind.
Thanks again for your work!
So quick, thanks you so much !
Every change seems to be perfect,
your Todo list is my final goal :wink:
About the bug, could you post the rrdgraph command generated when it appear ? (you can find it in Debug window)

Thanks again for your work :)

Re: [Module] Graph Editor

Posted: Fri Sep 17, 2010 10:28 pm
by RDNZL
Error:

Code: Select all

ERROR: Cannot parse vname from 'DEF:www.google.com_rtt=/home/ron/domotiga/rrd/www.google.com.rrd:rtt:AVERAGE'
Command:

Code: Select all

2010/09/17 22:21:28 [Graph Editor] rrdtool graph /tmp/gambas.1000/23626/15.tmp --lazy --start end-1d -a PNG --slope-mode --font DEFAULT:7: --watermark 'Domotiga v0.1.187' --width 400 --height 100 -c BACK#FFFFFF -c CANVAS#FFFFFF -c SHADEA#000000 -c SHADEB#000000 -c GRID#000000 -c MGRID#000000 -c FONT#000000 -c AXIS#000000 -c FRAME#000000 -c ARROW#000000 --title='Google Bug' --vertical-label '' DEF:www.google.com_rtt=/home/ron/domotiga/rrd/www.google.com.rrd:rtt:AVERAGE COMMENT:'\s' COMMENT:'                      ' COMMENT:'\l' LINE1:www.google.com_rtt#00FF00:'RTT                 ' COMMENT:'\s' COMMENT:'\s'  2>&1 >/dev/null
Others work ok, maybe because of the dots in the device name, quotes missing, dunno...?

Re: [Module] Graph Editor

Posted: Fri Sep 17, 2010 11:22 pm
by Minus
RDNZL wrote:Others work ok, maybe because of the dots in the device name, quotes missing, dunno...?
I found the reason, VDEF name (made from device name) can't be with a dot inside.

Source :
http://oss.oetiker.ch/rrdtool/forum.en. ... -td4617331
the reason for limiting the characterset of vnames is to
simplify parsing CDEF expressions (no , for example) and for future
enhancements. At the moment, allowing the . would not hurt, but it
would prevent us from using it for something more useful in the
future or we would have to come up with more backslash escapes
which do not help either ...
The solution could be to add in DeviceName2RRDName a regex to replace dot to whatever :

Code: Select all

sRRDName = Replace$(sRRDName, ".", "{whatever}")

Re: [Module] Graph Editor

Posted: Sat Sep 18, 2010 10:54 am
by RDNZL
I have fixed it in latest revision, it works ok now.
RRD databases will be saved without dots in their name, rename them manually if you have any, otherwise new/empty ones will be created next to it.

Re: [Module] Graph Editor

Posted: Mon Sep 20, 2010 4:26 pm
by hhg
Hi Minus/Ron

Very nice indeed. Is the Graphs displayed some other places rigth now, besides the preview vindow? Or is some one working on that code?

I ran into the same VDEF error, not because of punctuation, but because I had some Danish national letters in my sensor names (Room is "værelse" in danish).
So I will take a look at DeviceName2RRDName too see if I can restrict it to A-Z, mayby adding
sRRDName = Conv$(sRRDName, System.Charset, "ASCII")
Need to experiment here - Not that familar with Gambas.

Regards
hhg

Re: [Module] Graph Editor

Posted: Mon Sep 20, 2010 9:19 pm
by RDNZL
Because the new graphs are defined in the database now we can simply add a categories field and let the pages like climate energy etc display the graphs having the same category name.
Should we disable the old simple graphs display there?

Re: [Module] Graph Editor

Posted: Mon Sep 20, 2010 11:14 pm
by hhg
Yes, a categories field in the Graph Editor is the way to go. I don't think we should disable the simple graphs entirely, but perhaps and option under the Device Graph tab to enable/disable "Simple Graphs" - Default should be enabled, so "the out-of-the-box" experience is "Enable Graphing" and get a simple Graph!
If you only have a few sensors, that can do it - If more, use the Graph Editor.