Draw an area in a graph between two variables without stack.

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

Moderators: Developers, Moderators

Post Reply
FredZwarts
Posts: 20
Joined: Wed Feb 01, 2023 5:27 am

Draw an area in a graph between two variables without stack.

Post by FredZwarts »

I started using Cacti a few weeks ago. There is something I want to do, but I cannot find how to do it. If I missed something in the documentation, I would like a pointer.
I want to create a graph for a temperature. I want a line for the average temperature and I want to color the area between the minimum and maximum temperature. In order to draw this area, I cannot stack the maximum temperature on the minimum temperature, because their values would be added for the upper boundary of the area. I assume that I first have to subtract the minimum from the maximum and than stack that difference on the minimum using AREA:STACK. But how does one perform such a subtraction?
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Draw an area in a graph between two variables without stack.

Post by TheWitness »

Using a CDEF. You have to perform some light magic. To determine the DEF names as Cacti controls those, but that's what you do.
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?
FredZwarts
Posts: 20
Joined: Wed Feb 01, 2023 5:27 am

Re: Draw an area in a graph between two variables without stack.

Post by FredZwarts »

TheWitness wrote: Sat Feb 04, 2023 9:09 am Using a CDEF. You have to perform some light magic. To determine the DEF names as Cacti controls those, but that's what you do.
Where do I start to find those DEF names?
FredZwarts
Posts: 20
Joined: Wed Feb 01, 2023 5:27 am

Re: Draw an area in a graph between two variables without stack.

Post by FredZwarts »

FredZwarts wrote: Sat Feb 04, 2023 10:01 am
TheWitness wrote: Sat Feb 04, 2023 9:09 am Using a CDEF. You have to perform some light magic. To determine the DEF names as Cacti controls those, but that's what you do.
Where do I start to find those DEF names?
I think I found it already.
FredZwarts
Posts: 20
Joined: Wed Feb 01, 2023 5:27 am

Re: Draw an area in a graph between two variables without stack.

Post by FredZwarts »

TheWitness wrote: Sat Feb 04, 2023 9:09 am Using a CDEF. You have to perform some light magic. To determine the DEF names as Cacti controls those, but that's what you do.
It does not work. It tried 'cdef=CURRENT_DATA_SOURCE,CURRENT_DS_MINIMUM_VALUE,-',
but then the graph shows "ERROR: don't understand 'U,-'".
I also tried 'cdef=CURRENT_DS_MAXIMUM_VALUE,CURRENT_DS_MINIMUM_VALUE,-',
but then the graph shows "ERROR: don't understand 'U,U,-'".
Without the CDEF the graph is displayed without error; the maximum is stacked on the minimum, but then the upper boundary is much too high.
Apparently the CURRENT_DS_MAXIMUM_VALUE and CURRENT_DS_MINIMUM_VALUE are incorrect, but I have no idea what it should be.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Draw an area in a graph between two variables without stack.

Post by TheWitness »

I would not use the magic, but instead vnames start with a, b, c, ... Use those instead. Look at the Advanced Ping Graph template for some clues.
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?
FredZwarts
Posts: 20
Joined: Wed Feb 01, 2023 5:27 am

Re: Draw an area in a graph between two variables without stack.

Post by FredZwarts »

TheWitness wrote: Sat Feb 04, 2023 9:58 pm I would not use the magic, but instead vnames start with a, b, c, ... Use those instead. Look at the Advanced Ping Graph template for some clues.
Thanks! I think I have it working now.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Draw an area in a graph between two variables without stack.

Post by TheWitness »

Great.
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 1 guest