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

Koaps koaps at yahoo.com
Sat Feb 20 01:16:36 CET 2010


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.

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


      



More information about the rrd-users mailing list