Colour block on graph legend

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

Moderators: Developers, Moderators

Post Reply
stheologo
Posts: 14
Joined: Mon Jan 29, 2007 6:27 am

Colour block on graph legend

Post by stheologo »

Hi,

I have created a grapg template with a custom data query, that shows four different coloured lines on a graph. I have also created a legend showing min, ave and max values. The graph and legend work fine, but I cannot get the legend to show a little colour block t match the line. This is presnt in all the preconfigured graphs.
Any ideas???
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Yep. The COMMENTs won't get any color, never. Please check, whether the Graph Item that produces the LINEx does have a non-empty "Title Format". Else post the DEBUG output for that Graph from Graph Management
Reinhard
stheologo
Posts: 14
Joined: Mon Jan 29, 2007 6:27 am

Post by stheologo »

This is the out put of the debug, I have also attached svreenshots of the graph outputs. I have had to write the coulour in the legend to match the lines.

RRDTool Command:
/usr/local/rrdtool-1.0.49/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="STD_Channel_Utilization" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Utilization" \
DEF:a="/var/www/cacti-0.8.6h/rra/stdjhb_vmesh_carrier_1_705.rrd":Vmesh_Carrier_1:MAX \
DEF:b="/var/www/cacti-0.8.6h/rra/stdjhb_vmesh_carrier_2_706.rrd":Vmesh_Carrier_2:MAX \
DEF:c="/var/www/cacti-0.8.6h/rra/stdjhb_vmesh_carrier_3_707.rrd":Vmesh_Carrier_3:MAX \
DEF:d="/var/www/cacti-0.8.6h/rra/stdjhb_vmesh_carrier_4_708.rrd":Vmesh_Carrier_4:MAX \
LINE1:a#00FF00:"" \
LINE1:b#0000FF:"" \
LINE1:c#F5F800:"" \
LINE1:d#FF0000:"" \
GPRINT:a:MAX:"(Green) Ch1-510Kbs Max\:%8.2lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:a:MIN:"Min\:%8.2lf %s\n" \
GPRINT:b:MAX:"(Blue) Ch2-1600Kbs Max\:%8.2lf %s" \
GPRINT:b:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:b:MIN:"Min\:%8.2lf %s\n" \
GPRINT:c:MAX:"(Yellow) Ch3-1970Kbs Max\:%8.2lf %s" \
GPRINT:c:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:c:MIN:"Min\:%8.2lf %s\n" \
GPRINT:d:MAX:"(Red) Ch4-530Kbs Max\:%8.2lf %s" \
GPRINT:d:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:d:MIN:"Min\:%8.2lf %s\n"
RRDTool Says:
OK
Attachments
graph.GIF
graph.GIF (98.71 KiB) Viewed 2375 times
graph2.GIF
graph2.GIF (88.43 KiB) Viewed 2375 times
stheologo
Posts: 14
Joined: Mon Jan 29, 2007 6:27 am

Post by stheologo »

Just want to add, I do not want the text/comment to have colour, but a little colour block in front of the text
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please change the sequence of the Graph Items to read
LINE1:a#00FF00:"" \
GPRINT:a:MAX:"(Green) Ch1-510Kbs Max\:%8.2lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:a:MIN:"Min\:%8.2lf %s\n" \
LINE1:b#0000FF:"" \
GPRINT:b:MAX:"(Blue) Ch2-1600Kbs Max\:%8.2lf %s" \
GPRINT:b:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:b:MIN:"Min\:%8.2lf %s\n" \
LINE1:c#F5F800:"" \
GPRINT:c:MAX:"(Yellow) Ch3-1970Kbs Max\:%8.2lf %s" \
GPRINT:c:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:c:MIN:"Min\:%8.2lf %s\n" \
LINE1:d#FF0000:"" \
GPRINT:d:MAX:"(Red) Ch4-530Kbs Max\:%8.2lf %s" \
GPRINT:d:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:d:MIN:"Min\:%8.2lf %s\n"
Reinhard
stheologo
Posts: 14
Joined: Mon Jan 29, 2007 6:27 am

Post by stheologo »

Silly question, how do I do that. Do I redo the graph template or is there somewhere else I can change it??
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please use the "up" and "down" arrows next to the graph items
Reinhard
stheologo
Posts: 14
Joined: Mon Jan 29, 2007 6:27 am

Post by stheologo »

Made the change. Is there anything else I need to do, like get the graph to refresh, as there has ben no change
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Oops, yes. I suppose you will have to provide some text for those Graph Items providing the lines. I missed this when answering your post. I suppose this may have been all that was needed (e.g. shifting was not necessary)
Reinhard
stheologo
Posts: 14
Joined: Mon Jan 29, 2007 6:27 am

Post by stheologo »

Done all the above.. but still do not get the little colour block???
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please post your latest "rrdtool graph" command
Reinhard
stheologo
Posts: 14
Joined: Mon Jan 29, 2007 6:27 am

Post by stheologo »

Hi,


Here it is..

Thanks

LINE1:a#00FF00:"" \
GPRINT:a:MAX:"(Green) Ch1-510Kbs Max\:%8.2lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:a:MIN:"Min\:%8.2lf %s\n" \
LINE1:b#0000FF:"" \
GPRINT:b:MAX:"(Blue) Ch2-1600Kbs Max\:%8.2lf %s" \
GPRINT:b:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:b:MIN:"Min\:%8.2lf %s\n" \
LINE1:c#F5F800:"" \
GPRINT:c:MAX:"(Yellow) Ch3-1970Kbs Max\:%8.2lf %s" \
GPRINT:c:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:c:MIN:"Min\:%8.2lf %s\n" \
LINE1:d#FF0000:"" \
GPRINT:d:MAX:"(Red) Ch4-530Kbs Max\:%8.2lf %s" \
GPRINT:d:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:d:MIN:"Min\:%8.2lf %s\n"
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

But you haven't got any texts on the LINE1 graph items
gandalf wrote:... I suppose you will have to provide some text for those Graph Items providing the lines. ...
Edit the Graph Template. Then, please select the first Graph Item showing a LINE1. Provide a "Text Format". Repeat this for all LINE1 items
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests