[rrd-users] Complex RPN examples

David O'Brien dobrien at naccrra.org
Fri Dec 5 15:21:03 MET 2003


Hi
I have 4 DS's on a graph. Lets call them value1, value2, value3 and value4.
I want the larger value always drawn behind the rest with each DS having it's
own specific color ( for example:  value1 = red, value2 = white, value3 = 
blue, value4 = green )

What I want to happen rrdtool graph-wise

AREA=largest4#color4:Largest Number \
AREA=largest3#color3:Next Largest \
AREA=largest2#color2:Third Largest \
AREA=smallest#color1:Smallest of them all \

What I want to happen (pseudo-code)
Find which one is the largest:

if ( MAX( value1 , value2 , value3, value4 ) = value1 ) {
          color4 = red
} elseif ( MAX( value1 , value2 , value3, value4 ) = value2 ) {
          color4 = white
} elseif ( MAX( value1 , value2 , value3, value4 ) = value3 ) {
          color4 = blue
} elseif ( MAX( value1 , value2 , value3, value4 ) = value4 ) {
          color4 = green
}

Find which one is the smallest:

if ( MIN( value1 , value2 , value3, value4 ) = value1 ) {
          color1 = red
} elseif ( MIN( value1 , value2 , value3, value4 ) = value2 ) {
          color1 = white
} elseif ( MIN( value1 , value2 , value3, value4 ) = value3 ) {
          color1 = blue
} elseif ( MIN( value1 , value2 , value3, value4 ) = value4 ) {
          color1 = green
}


So I think that something like this will give me the largest DS of the four

CDEF:largest4=value1,value2,MAX,value3,MAX,value4,MAX

and something like this the smallest

CDEF:smallest=value1,value2,MIN,value3,MIN,value4,MIN

I need help figuring out the largest3 and largest2 values and assigning
the correct color to each of them.

Could any RPN ubermaster lend a hand?

-Dave


David G. O'Brien
Web Services Coordinator / Systems Administrator

NACCRRA
The Nation's Network of Child Care Resource & Referral
1319 F Street NW, Suite 500
Washington, DC 20004
(202) 393-5501 ext. 113
(202) 393-1109 fax


--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list