What I wanted to do is nicely arrange the values in the legend right-aligned in columns for MIN, LAST, AVERAGE, and MAX values.
I have used /t to arrange it more or less in columns however it is not really working since the numbers do not always align.
I noticed that in the graph template in the graph item types there is a "TEXTALIGN" in the pulldown menus providing "none", "left", "right", "justified" and "center". So I tried to use these but whatever I choose it does not change the placement of the figures of the legend at all.
This is my RRDTOOL command:
Code: Select all
/bin/rrdtool graph - \
--imgformat=PNG \
--start='-86400' \
--end='-300' \
--pango-markup \
--title='Legend' \
--vertical-label='Degrees Celsius (°C)' \
--slope-mode \
--base=1000 \
--height=200 \
--width=700 \
--alt-autoscale \
COMMENT:"From 2020/03/09 17\:17\:12 To 2020/03/10 17\:12\:12\c" \
COMMENT:" \n" \
--color BACK#F3F3F3 \
--color CANVAS#FDFDFD \
--color SHADEA#CBCBCB \
--color SHADEB#999999 \
--color FONT#000000 \
--color AXIS#2C4D43 \
--color ARROW#2C4D43 \
--color FRAME#2C4D43 \
--border 1 --font TITLE:11:'Arial' \
--font AXIS:8:'Arial' \
--font LEGEND:8:'Courier' \
--font UNIT:8:'Arial' \
--font WATERMARK:6:'Arial' \
--slope-mode \
--watermark 'Generated by Cacti®' \
DEF:a='/opt/cacti/rra/local_linux_machine_aussentemperatur_185.rrd':'KT_Nachlauf':AVERAGE \
DEF:b='/opt/cacti/rra/local_linux_machine_aussentemperatur_185.rrd':'KT_Vorlauf':AVERAGE \
COMMENT:'\t\t\tMinimum\t\t\tCurrent\t\t\tAverage\t\t\tMaximum\n' \
COMMENT:' -------------------------------------------------------------------------------\n' \
LINE1:a#B048B5FF:'KT_Nachl\:' \
GPRINT:a:MIN:'\t%8.2lf%s' \
TEXTALIGN:center \
GPRINT:a:LAST:'\t %12.2lf' \
GPRINT:a:AVERAGE:'\t%12.2lf' \
GPRINT:a:MAX:'\t%12.2lf\n' \
LINE1:b#F70D1AFF:'KT_Vorl\: ' \
TEXTALIGN:right \
GPRINT:b:MIN:'\t%8.2lf %s' \
GPRINT:b:LAST:'\t%8.2lf %s' \
GPRINT:b:AVERAGE:'%8.2lf %s' \
GPRINT:b:MAX:'%8.2lf %s\n' \
TEXTALIGN:right