[ANSWERED] Graph, RRDTool, Title in 2 lines

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

Moderators: Moderators, Developers

Post Reply
Author
Message
User avatar
Sirup
Cacti Moderator
Posts: 348
Joined: Tue Mar 02, 2010 9:03 am

[ANSWERED] Graph, RRDTool, Title in 2 lines

#1 Post by Sirup » Mon May 17, 2010 6:38 am

Is there a possibility to "wrap" the title of a graph in to lines?

Example in the screenshot
Attachments
lines.jpg
lines.jpg (13.12 KiB) Viewed 3490 times
Last edited by Sirup on Tue May 18, 2010 2:02 am, edited 1 time in total.
[size=67]Cacti version: 0.8.7e5
OS: FreeBSD 7.2
Plugin Architecture: 2.6
Plugins: aggregate 0.74, autom8 0.33, loginmod 1.0

[url=http://docs.cacti.net/manual:087]Official Cacti Documentation[/url]
[url=http://docs.cacti.net/manual:087:4_help.2_debugging#debugging]Gandalfs Official Debugging Help[/url]
[/size]

User avatar
Linegod
Developer
Posts: 1630
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

#2 Post by Linegod » Mon May 17, 2010 7:53 am

No. RRDTool does not support this.
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca

User avatar
Sirup
Cacti Moderator
Posts: 348
Joined: Tue Mar 02, 2010 9:03 am

#3 Post by Sirup » Tue May 18, 2010 2:02 am

Okay thanks a lot.
[size=67]Cacti version: 0.8.7e5
OS: FreeBSD 7.2
Plugin Architecture: 2.6
Plugins: aggregate 0.74, autom8 0.33, loginmod 1.0

[url=http://docs.cacti.net/manual:087]Official Cacti Documentation[/url]
[url=http://docs.cacti.net/manual:087:4_help.2_debugging#debugging]Gandalfs Official Debugging Help[/url]
[/size]

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#4 Post by gandalf » Tue May 18, 2010 3:12 pm

Linegod wrote:No. RRDTool does not support this.
J.P., yes, this is (has been?) the standard answer.

Now that I read it, it comes to my mind that rrdtool 1.4.x supports pango markup. This way, it may be possible to tweak a <br/> into the title. I did not test that. But if plain rrdtool 1.4.x works well, then Cacti 088 will support it!

R.

User avatar
Linegod
Developer
Posts: 1630
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

#5 Post by Linegod » Tue May 18, 2010 3:21 pm

I will see what I can do with v1.4 if I get a chance...
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca

User avatar
Linegod
Developer
Posts: 1630
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

#6 Post by Linegod » Tue May 18, 2010 4:44 pm

Just a test below. Not 'simple'.

I will take a look at 0.8.8 and see what I can do....
Attachments
rrdtool_1.3.9_newline.png
rrdtool_1.3.9_newline.png (23.22 KiB) Viewed 3437 times
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca

User avatar
Sirup
Cacti Moderator
Posts: 348
Joined: Tue Mar 02, 2010 9:03 am

#7 Post by Sirup » Wed May 19, 2010 2:20 am

Perfect! :lol:

How did you do this? So this will probably work with cacti 0.88 and rrdtool 1.4.x but not in the combo 0.88/1.4.x?
[size=67]Cacti version: 0.8.7e5
OS: FreeBSD 7.2
Plugin Architecture: 2.6
Plugins: aggregate 0.74, autom8 0.33, loginmod 1.0

[url=http://docs.cacti.net/manual:087]Official Cacti Documentation[/url]
[url=http://docs.cacti.net/manual:087:4_help.2_debugging#debugging]Gandalfs Official Debugging Help[/url]
[/size]

User avatar
Linegod
Developer
Posts: 1630
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

#8 Post by Linegod » Wed May 19, 2010 7:52 am

The '--pango-markup' option needs to be passed to the 'rrdtool graph' command. Unicode Entity in hexadecimal notation needs to be passed in the title for newline in the title.

It works with rrdtool 1.3.9, but it will have to wait for 0.8.8, as some logic around when to apply it will have to be included.
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca

User avatar
Sirup
Cacti Moderator
Posts: 348
Joined: Tue Mar 02, 2010 9:03 am

#9 Post by Sirup » Wed May 19, 2010 8:18 am

Thanks again - for the technical details
[size=67]Cacti version: 0.8.7e5
OS: FreeBSD 7.2
Plugin Architecture: 2.6
Plugins: aggregate 0.74, autom8 0.33, loginmod 1.0

[url=http://docs.cacti.net/manual:087]Official Cacti Documentation[/url]
[url=http://docs.cacti.net/manual:087:4_help.2_debugging#debugging]Gandalfs Official Debugging Help[/url]
[/size]

juangose
Posts: 12
Joined: Thu Jul 07, 2005 2:15 pm

Re: [ANSWERED] Graph, RRDTool, Title in 2 lines

#10 Post by juangose » Fri Jun 17, 2016 12:28 pm

What are the steps that I need in order to put 2 lines in the Title of the graphs.

juangose
Posts: 12
Joined: Thu Jul 07, 2005 2:15 pm

Re: [ANSWERED] Graph, RRDTool, Title in 2 lines

#11 Post by juangose » Fri Jun 17, 2016 12:30 pm

My version is Cacti 8.8b

MY RRD is 1.4.x

petski
Posts: 1
Joined: Wed Mar 08, 2017 7:20 am

Re: [ANSWERED] Graph, RRDTool, Title in 2 lines

#12 Post by petski » Wed Mar 08, 2017 7:34 am

[*] To use the pango-markup feature mentioned by Linegod, you can use it this way:

Code: Select all

--pango-markup --title='<span>Line1&#xa;Line2&#xa;Line3</span>'
The output will look like this (which is probably just fine if you use two lines, but not that pretty if you use more than two lines):

Image



[*] As a work-around, you can use a newline-patch I wrote for rrdtool-1.6.0. You can use it this way (with "?" as our separation character):

Code: Select all

--title='Line1?Line2?Line3'
The output will look like this:

Image

You can find the patch here: https://gist.github.com/petski/6240b64e ... d866cbeec1

Direct download link: https://gist.githubusercontent.com/pets ... title.diff

If you have any remarks on the code, please let me know on the gist page. I'll be happy to merge them!
Attachments
newlinehack.png
newlinehack.png (21.34 KiB) Viewed 1043 times
pango.png
pango.png (21.18 KiB) Viewed 1043 times

Post Reply