[rrd-users] Area in different colors
Simon Hobson
linux at thehobsons.co.uk
Tue Dec 4 16:42:29 CET 2007
I wrote:
>You mean something like :
>
> ggg ggggg g
> ooooooo oooooooo ooo
> rrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrr
>
>where r=red, o=orange, g=green
>
>How about something like this :
>
>if y>20 then a=20, else a=y
>if y>40 then b1=40, else b1=y
>...
>if y>80 then d1=80, else d1=y
>if y>80 then e=y-d1 else e=0
>d=d1-c1
>c=c1-b1
>b=b1-a
>area ... a ...
>area ... b ... stacked
>...
>area ... e ... stacked
Actually, this :
>d=d1-c1
>c=c1-b1
>b=b1-a
should probably be more like :
if y>d1 then e=y-d1 else e=unknown
if d1>c1 then d=d1-c1 else d=unknown
if c1>b1 then c=c1-b1 else d=unknown
if b1>a then b=b1-a else b=unknown
otherwise, b,c, d, and e will be drawn as a thin line on top of
whatever the graph comes to, giving the result of (I think) a single
pixel in colour of e contaminating the graph when y is less than 80.
Also, "if y>40 then b1=40, else b1=y" could be written as min(y,40)
or in RPN "40, y, min" I think.
Obviously, working out the correct RPN for this is left as an
exercise for the reader !
More information about the rrd-users
mailing list