[rrd-users] Can this kind of chart be drawn with RRDTool ?

Tobias Oetiker tobi at oetiker.ch
Sat Feb 20 08:23:53 CET 2010


Yesterday Koaps wrote:

> Hehe,
>
> I'm making progress too...
>
> You had to get the idea stuck in my head...
>
> https://test.null.bz/test9.php
> https://test.null.bz/test9.phps
>
> I looked up your domain to get a location, so the script will figure out sunset and sunrise for your Lat. Long and then try to make a gradient.
>
> Still working on getting the offsets right, but it's getting closer.
>
> I then take the PNG made by rrdtool and convert the blue background to transparent and overlay it over my image.
>
> This is all done by the server, so it will regenerate everything when the RRD image changes.
>
> If I get some more time I will play with it some more, GD is nice.

note that rrdtool can do transparent 'colors' natively ... just use
the fourth component of the color expression to generate
transparency ...

#rrggbbaa  or #rgba

cheers
tobi

>
> -k
>
>
> --- On Fri, 2/19/10, Jean-Yves Avenard <jyavenard at gmail.com> wrote:
>
> > From: Jean-Yves Avenard <jyavenard at gmail.com>
> > Subject: Re: [rrd-users] Can this kind of chart be drawn with RRDTool ?
> > To: "A Darren Dunham" <ddunham at taos.com>
> > Cc: rrd-users at lists.oetiker.ch
> > Date: Friday, February 19, 2010, 7:20 AM
> > Hi
> >
> > Making progress on the matter.
> >
> > http://htpc.avenard.org/power/?small=1&graph=1&view=day&date=19/02/2010&hour=23&minute=59&plot=total,ext
> >
> > I'm trying to draw a blue area between sunrise and
> > sunset...
> >
> >                
> >                
> >   "VRULE:$sunrise#32348e",
> >                
> >                
> >   "VRULE:$sunset#32348e",
> >                
> >                
> >   "VRULE:$sunnoon#000000",
> >                
> >                
> >   "VRULE:$dawn#272727",
> >                
> >                
> >   "VRULE:$dusk#272727",
> >                
> >                
> >   "DEF:tt=blah.rrd:total:AVERAGE",
> >
> > "CDEF:day=tt,POP,UNKN,INF,TIME,$sunrise,$sunset,LIMIT,UN,IF",
> >                
> >                
> >   "AREA:day#32348e"
> >
> > I draw 5 vertical lines, at dawn, sunrise, sunset, dusk and
> > solar noon
> > (to fullfill my curiosity)..
> >
> > As I can't create a CDEF from a RpN expression without
> > using a
> > reference to a DEF or CDEF, so I read a dummy RRD that I
> > know as data
> > continously. In the RPN expression I remove the date, and
> > check if
> > TIME is between sunrise and sunset. If yes, I push INF back
> > on the
> > stack ; which should plot the whole screen.
> >
> > But it doesn't :)
> >
> > What did I miss?
> >
> > It's pretty much:
> > IF (TIME > sunrise && TIME < sunset) then
> > plot INF else plot UNKN
> >
> >
> > Thanks
> >
> > _______________________________________________
> > rrd-users mailing list
> > rrd-users at lists.oetiker.ch
> > https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
> >
>
>
>
>
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900


More information about the rrd-users mailing list