TEXTALIGN

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
Wirthmueller
Cacti User
Posts: 60
Joined: Wed Mar 02, 2011 9:02 am

TEXTALIGN

Post by Wirthmueller »

I am using cacti version 1.2.8 running on a linux PC (ubuntu).

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

Any help to this?
User avatar
TheWitness
Developer
Posts: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: TEXTALIGN

Post by TheWitness »

I think TEXTALIGN is just for wrapping. What we need is a new form of tab and not so much an align. There is presently a tab width, but there is to my knowledge, no center align tab, or right align tab. You should check me on that. This makes creating a good alignment difficult. You can set the widths of the various GPRINT data but that does not cover all alignment situations.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests