HTML in a graph

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

Moderators: Developers, Moderators

Post Reply
tandrews
Posts: 19
Joined: Mon Mar 14, 2005 3:14 pm

HTML in a graph

Post by tandrews »

Had a thought today and am wondering if anyone has done something like this...

I'm graphing core switches and associated edge switches. On the graphs of each port on the core switch I would like to add a link that takes me to the graph of the associated edge switch connected to that port. Any thoughts on manually adding html to individual graphs?

---Edit---

Is there a way to add html in the Title when editing an individual graph?
dtr
Posts: 13
Joined: Mon Feb 28, 2011 4:53 am
Location: Germany

Re: HTML in a graph

Post by dtr »

In my installation I edited the files cacti/site/graph.php and cacti/site/lib/html.php to add a link to the side of each graph (below the buttons that are already on the side of each graph).

In my case it was rather easy, since I needed just a link to a site which has a part of the titlecache variable in the url. Maybe you could use a similar solution, if you put the id of the graph you want to link to in the graph title...
tandrews
Posts: 19
Joined: Mon Mar 14, 2005 3:14 pm

Re: HTML in a graph

Post by tandrews »

dtr wrote:In my installation I edited the files cacti/site/graph.php and cacti/site/lib/html.php to add a link to the side of each graph (below the buttons that are already on the side of each graph).

In my case it was rather easy, since I needed just a link to a site which has a part of the titlecache variable in the url. Maybe you could use a similar solution, if you put the id of the graph you want to link to in the graph title...
I guess it's only something I need for a few graphs. Was just thinking there might be a way to parse a url in the "Title" field of the Supplemental Graph Template Data area.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: HTML in a graph

Post by gandalf »

Version 089 will support almost all known rrdtool features. And as far as I know, there's an option to add html to the rrd graph. But I fear this is for legend only.
R.
tandrews
Posts: 19
Joined: Mon Mar 14, 2005 3:14 pm

Re: HTML in a graph

Post by tandrews »

gandalf wrote:Version 089 will support almost all known rrdtool features. And as far as I know, there's an option to add html to the rrd graph. But I fear this is for legend only.
R.
The location of the link is not important... only that it exist somewhere on the graph and that I can edit it per graph... just like the Title. I've been looking at all the .php and it is not obvious to me where the field would be created and how the url would be passed to RRDTool... but then I have no php skills. ;)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: HTML in a graph

Post by gandalf »

You will provide the link via either graph template or graph specific options, then. The code for 089 regarding this feature is already complete but not yet tested
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest