[rrd-users] Legend alignment

Cole Tuininga cole.tuininga at gmail.com
Mon Dec 10 22:45:14 CET 2007

Hi folks -

I'm running rrdtool 1.2.23 on a freebsd system and am having a little
trouble with the alignment of the legend.  Typically, the graphs I'm
generating end up having a legend with three items per row, and I want
each of these columns to be lined up.  The problem seems to occur only
on the second and third column of the last line in each graph.

For instance, if I have label1 to label9, the first two rows will have
all three columns lined up correctly.  On the third row, the first
column will be lined up but the second and third will be offset.

For reference, the approach I've used to get them to line up so far is
to pad all the labels with spaces to get them to the same length as
the longest label in the list.

An example of a problematic graph can be seen at

The relevant portions of the rrdtool command line look like this
(sorry some of it needed to be removed for reasons of proprietary data

/usr/local/bin/rrdtool graph \
/path/to/rrdgraph.png \
-z -E -i \
-v Queries Per Second \
-u 0.1 \
-X 0 \
--start 1197234000 \
--end 1197320400 \
-t 1 Day \
AREA:GRAPH1#fc9d2a:Record Type\:A    . \
AREA:GRAPH11#ac6a1d:Record Type\:AAAA .:STACK \
AREA:GRAPH4#764913:Record Type\:CNAME.:STACK \
AREA:GRAPH2#57a0ce:Record Type\:KEY  .:STACK \
AREA:GRAPH7#3f7394:Record Type\:LOC  .:STACK \
AREA:GRAPH9#5e676c:Record Type\:MX   .:STACK \
AREA:GRAPH6#45a1fd:Record Type\:NS   .:STACK \
AREA:GRAPH8#99d7fe:Record Type\:PTR  .:STACK \
AREA:GRAPH5#d3c226:Record Type\:SOA  .:STACK \
AREA:GRAPH10#1b5f73:Record Type\:SRV  .:STACK \
AREA:GRAPH3#fc9d2a:Record Type\:TXT  .:STACK

I threw the period in at the end of the label just to get a visual
idea of where the label was ending.  I should mentioned that this
command line is generated dynamically and has a variable number of
data sets to graph.

Am I taking the wrong approach to getting these lined up?  Any ideas?

Many thanks in advance.

Cole Tuininga

More information about the rrd-users mailing list