From: Laurent Destailleur Date: Thu, 27 Jun 2019 09:04:23 +0000 (+0200) Subject: Fix use the 5 top hits as base 100 for graph to show the top 5 hits. X-Git-Tag: AWSTATS_7_8~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1afee24384a9548f64e5638593561d60801f387a;p=thirdparty%2FAWStats.git Fix use the 5 top hits as base 100 for graph to show the top 5 hits. --- diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 0ddcba4f..9cfe019d 100755 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -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 ""; my $function = "ShowGraph_$pluginname"; &$function(