Dynamic Font Color Question - Weathermap 0.97+

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
stvlange
Posts: 7
Joined: Tue Sep 20, 2011 11:58 am

Dynamic Font Color Question - Weathermap 0.97+

Post by stvlange »

Hey guys, was wondering if you could help me out with a quick weathermap question. What I would like to know is if it is possible to specify a node font color based on the current position in the scale. For instance, if it is between 0-20% the font color is white, 21-100% it is black. To complicate matters some, I am using the built in icon box function to give all of my nodes the same size.

For example:

Code: Select all

NODE GALLOWAY
        LABELOFFSET C
        ICON 200 25 box
        USESCALE DEFAULT
        LABELOUTLINECOLOR none
        AICONFILLCOLOR copy
        LABEL GALLOWAY ({node:this:bandwidth_in:%k}B OF 1.5MB)
        POSITION 710 241
        MAXVALUE 1.5M
        TARGET {map:cacti_path_rra}/gal_cisco_switch_traffic_in_1007.rrd:traffic_in:- {map:cacti_path_rra}/gal_cisco_switch_traffic_in_1007.rrd:traffic_out:- {map:cacti_path_rra}/gal-wg_edge_traffic_in_1081.rrd:traffic_in:- {map:cacti_path_rra}/gal-wg_edge_traffic_in_1081.rrd:traffic_out:-
I initially tried using LABELBGCOLOR but it seems since I am using ICON it overrides it. LABELOUTLINECOLOR does work if tested. As you can see from my traffic scale in the attached picture, when the traffic is at the lowest levels it's hard to read the font in the node name. More than likely I'll just get rid of the darker colors on the scale but I thought I would pose the question to see if there was a better way to do it.

Lastly, does anyone know of a good way to use something like a speedometer for to display traffic? I played a little bit with inpie and outpie but it's not quite what I'm looking for. Thanks!
Attachments
Picture0001.png
Picture0001.png (21.55 KiB) Viewed 2445 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Dynamic Font Color Question - Weathermap 0.97+

Post by Howie »

You can't do it with a scale, but for that specific problem use
LABELFONTCOLOR contrast
and it will automatically choose black or white as appropriate.

The AICON stuff is a little unfinished, but I thought there was also a gauge type, which is more like a speedometer.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
stvlange
Posts: 7
Joined: Tue Sep 20, 2011 11:58 am

Re: Dynamic Font Color Question - Weathermap 0.97+

Post by stvlange »

Howie wrote:You can't do it with a scale, but for that specific problem use
LABELFONTCOLOR contrast
and it will automatically choose black or white as appropriate.

The AICON stuff is a little unfinished, but I thought there was also a gauge type, which is more like a speedometer.
You Sir are a god. "LABELFONTCOLOR contrast" worked like a charm! My apologies if I missed that in the online reference. I'll play around with the gauge type and see what it looks like. Thanks Howie.

-Steve
stvlange
Posts: 7
Joined: Tue Sep 20, 2011 11:58 am

Re: Dynamic Font Color Question - Weathermap 0.97+

Post by stvlange »

Really liking the contrast setting!
Attachments
Picture00023.jpg
Picture00023.jpg (42.13 KiB) Viewed 2406 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Dynamic Font Color Question - Weathermap 0.97+

Post by Howie »

:-) See, I do use my own software, so I do solve some of these kinds of problems...
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest