I use AWStats for website statistics for a lot of sites and I'm perfectly happy with the software. AWStats can be run as a CGI or standalone for the creation of static html pages with statistics.
The chart capabilities of AWStats are fairly limited, however. So I searched for a plug-in to replace the complicated tables for barcharts in AWStats with Google Chart API images to reduce the html page size and to provide cleaner charts.
Such a plug-in didn't exist, so I build my own based on the graphapplet.pm which is provided which AWStats, but experimental, and displays charts using a Java applet. I'm not a big fan of using Java in web pages as the plug-in tends to slow down the loading and introduces security troubles.
So here it is, a first version of the Google Chart API plugin for AWStats. It is fairly simple and it works very fast. Also it reduces the main statistic html page from about 70 KB to around 40 KB, so it loads much faster.
Disclaimer: no warranties, use a your own risk, your milage may very, etc., etc.
To use the plug-in, use a AWStats with version 6 or up. To install the plug-in, replace the graphapplet.pm file in the plugin directory of the AWStats installation with the one below. Backup the original file to be safe. I can't add a module with a different name because that would require changes to the core AWStats module itself.
Also activate the loading of the plugin using the following directive in your AWStats config file:
LoadPlugin="graphapplet"
Comments or suggestions? Please let me know.
Update 23-06-2010: The new AWStats 7.0 beta has been released and it includes the new GraphGoogleChartApi AWStats plugin! The plugin has been updated with extensive enhancements written by Chris Larsen which really make the charts in AWStats shine. Check it out at: http://awstats.sourceforge.net/
| Bijlage | Grootte |
|---|---|
| graphapplet.pm | 3.56 KB |
Ingezonden door mo6 op za, 2009-11-07 12:20
AWStats 7.0 beta includes Google Chart plugin
The new AWStats 7.0 beta has been released and it includes the new GraphGoogleChartApi AWStats plugin! The plugin has been updated with extensive enhancements written by Chris Larsen which really make the charts in AWStats shine. Check it out! :)
http://awstats.sourceforge.net/
AWStats Google Chart API plugin in AWStats release
I recently received mail from the author of the AWStats package that the plugin is included in the development version of AWStats (CVS version) under the name of "graphgooglechartapi". I'll update the plugin soon to display all the bars of the AWStats charts.
Thanks, for this plugin. But
Thanks, for this plugin.
But in my case, I have german umlauts in the name of month (e.g., März = March).
After these lines (near line 19-20):
#use strict;
no strict "refs";
I add follow lines:
use HTML::Entities;
use utf8;
Change this line (near line 133):
# display labels
foreach my $i (1..(scalar @$blocklabel)) {
$b = "".@$blocklabel[$i-1];
$b = substr($b,0,$maxlabellen);
print $b ."|";
}
Into this line:
# display labels
foreach my $i (1..(scalar @$blocklabel)) {
$b = "".decode_entities(@$blocklabel[$i-1]);
$b = substr($b,0,$maxlabellen);
$b = encode_utf8($b);
print $b ."|";
}
Have a nice day. ;-)
it works!
Hello.
Thank you for sharing your plugin. I've tested it right now on Debian Lenny for sparc + apache2 + awstats 6.95. It's faster than the one which uses java, and doesn't bother if your browser doesn't support or disables java. I could never let the graphapplet working before, this solution has solved my problem :-) Thanks a lot.