howardjones / network-weathermap

Network Weathermap draws diagrams from data
http://www.network-weathermap.com/
MIT License
425 stars 94 forks source link

Pie Charts not colorizing properly - database-refractor 20170602 code #107

Closed jjhunt closed 7 years ago

jjhunt commented 7 years ago

Running the database-refractor 20170602 code, I'm seeing that pie charts are not being colorized using the scale specified. I've attached a weathermap configuration (dhcp.conf) which illustrates this.

Using weathermap 0.97c, this pie chart is colorized green, per the SCALE selected. With the database-refractor weathermap code, the pie chart is showing as all black. I'm also seeing the error:

WEATHERMAP: Poller[0] WARNING: [Map 221] dhcp.conf: Unrecognised config on line 37: AICONOUTLINECOLOR copy

This is a useful feature for us, as we have multiple pie charts, and want to easily identify the ones with issues by colorizing them. Thanks for any info on this.

dhcp.conf.txt

jjhunt commented 7 years ago

Oops! I just remembered, this was a feature we had added to our weathermap 0.97c install. See: http://forums.cacti.net/viewtopic.php?f=16&t=53402 Not sure it was ever officially added to weathermap code. We do use though, so I'll look into it more. Sorry for confusion on that! --Jackie

howardjones commented 7 years ago

Adding as a 'feature' issue. Shouldn't be a problem to re-add.

jjhunt commented 7 years ago

That would be awesome. Thanks for your help Howie!

jjhunt commented 7 years ago

Also relating to pie charts. I'm finding that 0% and >360% pies don't render properly. We see that sometimes this with bad configs or data. I added the following lines to the drawArtificialIconPie function, and the result is more accurate:

   $segmentAngle = min((($percentValue / 100) * 360), 360);
   if ($segmentAngle <= 1) $segmentAngle = 1;
howardjones commented 7 years ago

Good call. I'll make sure that goes in, too. The AICONOUTLINECOLOR copy is in my local copy now, and working. I have to get some other stuff working before pushing a bunch of commits. Otherwise I get complaints :-) (the latest commit of a dev branch doesn't always work - who knew?)

jjhunt commented 7 years ago

That's great that you have "AICONOUTLINECOLOR copy" working. Thanks for all your help with this. I've been running the June 2nd commits all week, and seems pretty stable for our purposes....after making readConfigFile function public that is. :-)

howardjones commented 7 years ago

Yeah... since then I got annoyed with having multiple versions of the old ugly cacti plugin code, so I've rewritten a lot of it to use some work I did a couple of years ago. But it's not completed yet, parts of the map management screen don't work.

jjhunt commented 7 years ago

OK, good to know. Sounds like you are going to do it right....appreciate that!