]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Fix use the 5 top hits as base 100 for graph to show the top 5 hits.
authorLaurent Destailleur <eldy@destailleur.fr>
Thu, 27 Jun 2019 09:04:23 +0000 (11:04 +0200)
committerLaurent Destailleur <eldy@destailleur.fr>
Thu, 27 Jun 2019 09:04:23 +0000 (11:04 +0200)
wwwroot/cgi-bin/awstats.pl

index 0ddcba4f0dd04af6393de9d7e248a4ec3c40fa66..9cfe019d996c8235917363ea88cec32eafbe0fb9 100755 (executable)
@@ -14907,13 +14907,23 @@ sub HTMLMainHosts{
                        my @blocklabel = ();
                        my @valdata = ();
                        my @valcolor = ($color_p);
+
                        my $cnt = 0;
+                       my $suma = 0;
                        foreach my $key (@keylist) {
-                               push @valdata, int( $_host_h{$key} / $TotalHits * 1000 ) / 10;
-                               push @blocklabel, "$key";
-                               $cnt++;
-                               if ($cnt > 4) { last; }
+               $suma=$suma + ( $_host_h{$key});
+               $cnt++;
+               if ($cnt > 4) { last; }
                        }
+                       
+                       my $cnt = 0;
+                       foreach my $key (@keylist) {
+               push @valdata, int( $_host_h{$key} / $suma * 1000 ) / 10;
+               push @blocklabel, "$key";
+               $cnt++;
+               if ($cnt > 4) { last; }
+                       }
+                       
                        print "<tr><td colspan=\"7\">";
                        my $function = "ShowGraph_$pluginname";
                        &$function(