[rrd-users] outputting lines and legends in order of weighting

Alex van den Bogaerdt alex at ergens.op.het.net
Mon Jul 14 01:22:26 CEST 2008


On Thu, Jul 10, 2008 at 06:04:10PM -0700, Joseph Mack NA3T wrote:

> However when I plot the boxes in the legend with the colors 
> and value of offset for each ntp peer with the lowest 
> priority lines being written first, the lowest priority peer 
> is written out in the legend first. Is there a way to write 
> out the highest priority legend (and its color) first?
> 
> I'm happy to do some fakery, eg make two passes at writing 
> out the data (eg one for the lines in one order and another 
> for the legend in the other order), but I can't figure how 
> to do it.

First draw the lines without a legend.
Then write a legend without drawing a line. To do this, you need
to draw something blank. And this in turn means you first need to
generate something blank.

If you have:

DEF:ds0=test.rrd:ds0:AVERAGE \
DEF:ds1=test.rrd:ds1:AVERAGE \
LINE:ds0#FF0000:ds0 \
LINE:ds1#0000FF:ds1 \

then you change above two LINE in below CDEF and four LINE:

CDEF:not=ds0,POP,UNKN \
LINE:ds0#FF0000 \
LINE:ds1#0000FF \
LINE:not#0000FF:ds1 \
LINE:not#FF0000:ds0 \

HTH
-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/



More information about the rrd-users mailing list