Hi everyone,
I'm not sure where the best place to submit a patch is -- mailing list, or somewhere on the forum?
Anyway, I've been working on pulling in images directly from graph_image.php for use in some outside "web gadgets." I didn't need a title in the image since my web app already does this, and it was a real pain to try and shoehorn the resolution of the full image into a specific size of a div tag. (Since RRD is generating a graph based on the resolution of the data canvas, not the entire image with legend and stuff) If the resolution is off, the browser attempts to do a quick & dirty resize of the image which results in some nasty looking artifacts in the graphs.
I've added these options to graph_image.php:
graph_notitle=Y -- disable generation of the title in the graph. (Translates to the --title option on rrdgraph)
graph_full_size=Y -- the graph_width and graph_height resolutions specify the FINAL dimensions of the image, including title, legend, and rules. (Translates to the --full-size-mode option to rrdgraph)
This patch was created against Cacti 0.8.7g.
Thanks for your consideration into the official source! It would be handy to do upgrades and not have to manually apply my patch to new versions.
PATCH: graph_image.php and gadgets
Moderators: Developers, Moderators
PATCH: graph_image.php and gadgets
- Attachments
-
- cals_gadget.patch
- Patch to graph_image.php and lib/rrd.php
- (2.35 KiB) Downloaded 272 times
--Cal
Re: PATCH: graph_image.php and gadgets
I can show a little example of this. Here's what it looked like before:
Some graphs look worse than others, but you can see artifacts in the title and legend text.
With my patch, and creating an image that matches the exact dimensions of the div around it, it's nice and clear:
Much cleaner looking!
Some graphs look worse than others, but you can see artifacts in the title and legend text.
With my patch, and creating an image that matches the exact dimensions of the div around it, it's nice and clear:
Much cleaner looking!
--Cal
Re: PATCH: graph_image.php and gadgets
Nice work! :D
Especially,
(Notice: "--full-size-mode" option is available since RRDtool 1.3)
Here is a sample for my 24-port switch.
(I added some "--color" options to 'rrd.php', and using customized graph template)
Especially,
thanks to this, I can place graphs like as "tile", regardless of plot area size.calh wrote:graph_full_size=Y -- the graph_width and graph_height resolutions specify the FINAL dimensions of the image, including title, legend, and rules. (Translates to the --full-size-mode option to rrdgraph)
(Notice: "--full-size-mode" option is available since RRDtool 1.3)
Here is a sample for my 24-port switch.
(I added some "--color" options to 'rrd.php', and using customized graph template)
Re: PATCH: graph_image.php and gadgets
Thanks!
I didn't realize that option was only available after RRD 1.3... I suppose a version check could be added, but then again, most new Cacti installs should be using the latest RRD tool as well.
I didn't realize that option was only available after RRD 1.3... I suppose a version check could be added, but then again, most new Cacti installs should be using the latest RRD tool as well.
--Cal
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: PATCH: graph_image.php and gadgets
Many of this options are now implemented in TRUNK. I'm eagerly awaiting an alpha of this as I don't want to backport all those options. Many, many code changes ...
R.
R.
Re: PATCH: graph_image.php and gadgets
Oh did you already code this stuff, it just hadn't been released yet? Or did you add my patch to subversion?
I'll also be on the pulse of another Cacti release, as there are quite a few things I'm looking forward to for features / fixes.
Thank you!
I'll also be on the pulse of another Cacti release, as there are quite a few things I'm looking forward to for features / fixes.
Thank you!
--Cal
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: PATCH: graph_image.php and gadgets
I didn't check your patch, to be honest. But I implemented virtually _every_ rrdtool graph option available with rrdtool 1.4.4. This has been done more than 6 months ago ...
R.
R.
Who is online
Users browsing this forum: No registered users and 1 guest