How to shade the area between two lines?

If you figure out how to do something interesting/cool in Cacti and want to share it with the community, please post your experience here.

Moderators: Developers, Moderators

Post Reply
zardoz
Posts: 7
Joined: Fri Jun 03, 2005 9:52 am

How to shade the area between two lines?

Post by zardoz »

I am logging temperature data from an external sensor and supplying this information to Cacti via a custom SNMP OID. As a result I am obtaining a line which represents the current temperature. However from the RRD file that is generated,I can also find the minimum and maximum temperatures for a particular time period. This results in an extra two lines on my graph representing the minimum and maximum for a day or a week. What I would like to do is to shade the area between these two lines, thereby identifying clearly the range of temperatures for a particular day or week. I have not been able to find any mechanism that allows me to shade between two arbitrary lines, where negative numbers are involved. Does anyone know of any way of doing this such that only the area between the minimum and maximum lines is shaded?
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: How to shade the area between two lines?

Post by TheWitness »

For the minimum use a, then for the max use an area fill with the shade color that stacks on top of the line, use a CDEF to subtract max-min and then follow that up with a line at average and a line at max.

The real trick is the STACK and the CDEF.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests