Colour based on data value...

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

Moderators: Developers, Moderators

Post Reply
User avatar
Alice
Cacti User
Posts: 111
Joined: Tue Oct 28, 2003 4:54 pm
Location: Bucharest, RO.

Colour based on data value...

Post by Alice »

something like SmokePing:
http://people.ee.ethz.ch/~oetiker/webtools/smokeping/
(that's not the best image, but you understand what I mean)

Actually I want something else if I think better :p

Simple example:
Number of users logged on.
1-10: green
10:40: yellow
30-100: purple
100+: red

(or it's possible to do this already but I don't know how? :D)
jamiebah
Posts: 15
Joined: Wed Aug 13, 2003 5:32 pm
Location: Litchfield, MN
Contact:

Use CDEF

Post by jamiebah »

Use a CDEF to show colors and multiple graph items from one data source.

ex. For my APC battery backup units, I want to know how warm they are.
I have one data source, and 3 graph items.
(In my situation, I convert from celsius to farenheit first)
Here are cdefs that I use:

This one will filter temps from 0-39.99 degrees F
Item #1 Special Data Source: CURRENT_DATA_SOURCE
Item #2 Custom String: 1.8
Item #3 Operator: *
Item #4 Custom String: 32
Item #5 Operator: +
Item #6 Custom String: 0
Item #7 Custom String: 39.99
Item #8 Function: LIMIT


This one shows between 40.00 and 78.99 degrees F
Item #1 Special Data Source: CURRENT_DATA_SOURCE
Item #2 Custom String: 1.8
Item #3 Operator: *
Item #4 Custom String: 32
Item #5 Operator: +
Item #6 Custom String: 40.00
Item #7 Custom String: 78.99
Item #8 Function: LIMIT

This one shows between 79.00 and 150 degrees F
Item #1 Special Data Source: CURRENT_DATA_SOURCE
Item #2 Custom String: 1.8
Item #3 Operator: *
Item #4 Custom String: 32
Item #5 Operator: +
Item #6 Custom String: 79.00
Item #7 Custom String: 150
Item #8 Function: LIMIT

Each one of these is assigned to one graph item, I have 3 graph items and they are all set to area as line left gaps.

The cdef limits what the particular graph item will draw, if its out of the bounds of the cdef, it won't get drawn. So, I use purple for the 0-39.99, green for the 40.00-78.99, and red for the 79.00-150 cdef

I hope this helps...
User avatar
Alice
Cacti User
Posts: 111
Joined: Tue Oct 28, 2003 4:54 pm
Location: Bucharest, RO.

Post by Alice »

yep, I think it helps.
I'll try it asap. Thanx a lot!

Edit: It DOES help :)
I think this thread should be moved to HOWTO's
[url=http://www.x-graphs.com/]http://www.x-graphs.com[/url] [color=red]X[/color]-[color=blue]graphs[/color] :: All kind of graphs
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

Alice wrote:I think this thread should be moved to HOWTO's
Done ;-).

-Ian
TPC
Posts: 29
Joined: Wed Oct 06, 2004 12:14 pm

Post by TPC »

You said you had breaks by using Line graphs..
I tried with Area graphs and I had break too..
Before I set my limits like this.
0-49
50-99
100-149..etc

I fixed it by adding a couple of .99999s at the back of my CDEFs custom strings .. like this

0-49.99999999
50-99.99999999
100-149.99999999

It sorta works for me.. no more little minute gaps :P Does it work for line graphs.. I have no clue :)

edit : oh geesh .. just realised i digged up a 1 year old thread :oops:
X505
Posts: 39
Joined: Fri Jun 29, 2007 3:53 pm
Contact:

Post by X505 »

TPC wrote:You said you had breaks by using Line graphs..
I tried with Area graphs and I had break too..
Before I set my limits like this.
0-49
50-99
100-149..etc

I fixed it by adding a couple of .99999s at the back of my CDEFs custom strings .. like this

0-49.99999999
50-99.99999999
100-149.99999999

It sorta works for me.. no more little minute gaps :P Does it work for line graphs.. I have no clue :)

edit : oh geesh .. just realised i digged up a 1 year old thread :oops:
I dig an almost 5 years old post to say thanks !
@TPC : i got the same problem even with your trick, that's because i used the Slope Mode (--slope-mode).
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest