Sexy Cacti Graphs

January 23, 2008 at 12:55 am 1 comment

I admit it. I’m a newbie when it comes to Cacti. Having said that though, I’ll say that I’m a pretty fast learner, and Cacti is one heck of a tool that can be extended many ways just though a simple WebGUI. I started using Cacti about a month and a half ago, but have only gotten deep into it within the last few weeks.

One thing that has bothered me a bit from the beginning was the somewhat anemic look of Cacti’s graphs. Regardless of how it looks, it does the job of displaying the data, but perhaps the Mac side of me wants it done with a bit more style. So, I set off to finding out a better way.

In the course of updating to the latest version (0.8.7a), I discovered that Cacti now supports opacity, meaning that I can now be able to have area graphs that are partially transparent. Sweet!

However, this wasn’t as easy as flipping a switch. Through literally hours of experimentation, I concluded that setting fairly low settings of opacity was generally not good because the color ended up being too light, making it difficult to see the edge. With mid-level opacity, the colors didn’t seem to turn out to be what you’d expect when they “mixed”… (Yellow and Blue should make a nice Green, not a puke green!) Further, I concluded that just about any color combination with a relatively high opacity setting looks terrible, as it approaches some semi-brown color.

A couple days passed without me giving it much thought. It was as I sat looking at a graph on another website that I realized that this graph looked excellent, even though it had two areas that were very light in color (a very low opacity setting). As I looked at it, I realized the reason that it looked so good was that it had a very dark edge to each of the colors, outlining the highest area. That’s when another idea struck. It was a bit “outside the box”, as it were, but I thought that it would probably work. My idea? Graph the same data twice – Once as an area, and once as a line. Simple – but would Cacti let me do it? And more importantly, would it look any good?

Below is the default look for traffic graphs in Cacti, captured from one of the public demonstration Cacti sites:

Standard Traffic Graph

It gets the job done, but you have to admit that it’s pretty “Plain Jane”.

Now, feast your eyes on the gorgeous graph bits below:

New Cacti Traffic Graph

Now, tell me that isn’t a major improvement in looks?

The secret to the beauty that is above is really quite simple.  In addition to graphing the areas with a level low level of opacity (10% – making them very transparent), I added similarly colored lines set to 100% opacity.  The labels for the areas were removed and placed upon the solid lines.  The spacing between “Inbound” and “Current” near the bottom of the graph is so wide because the areas don’t have labels.

In case I’ve not explained this as well as I could have, here’s a screenshot of the config screen for this Graph Template.  (Click the thumbnail to see it)

Cacti Configuration

Updated 01/20/2015:

I recently had to re-create this and realized I had refined my technique since this post.  I now put the AREA items above the LINE1 items.  The AREAs are added with blank labels, and the LINE1 item is where the label is added.  This helps with the spacing in the graph key.  With LINE1 above AREA, it left a big gap between the key item (Inbound) and the Current: label.  Reversing this eliminates the gap.


Entry filed under: Networking.

Torrents for content delivery over MPLS? Tracking your finances

1 Comment Add your own

  • 1. jchaven  |  March 8, 2012 at 4:20 pm

    That’s pretty clever! I never thought of adding extra areas for the same data and different appearances.



Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


January 2008
« Dec   Feb »

Most Recent Posts

%d bloggers like this: