Add graphsvg plugin: inline-SVG charts (replacement for the dead Google Chart API)#289
Open
ShaiMagal wants to merge 1 commit into
Open
Add graphsvg plugin: inline-SVG charts (replacement for the dead Google Chart API)#289ShaiMagal wants to merge 1 commit into
ShaiMagal wants to merge 1 commit into
Conversation
…rt API
The graphgooglechartapi plugin builds charts as <img> tags pointing at the
Google Image Charts API (chart.googleapis.com) and the country map via the
Google Visualization "geomap". Google shut down the Image Charts API in
March 2019, and the Flash-based GeoMap even earlier, so these charts now
render as broken images on every modern report.
graphsvg is a drop-in replacement implementing the same ShowGraph hook and
the same graph types, but it draws everything locally as self-contained
inline SVG:
* column charts for the time graphs (month, days of month, days of week,
hours), with week-end shading and a bold "current day" label
* pie charts for the top-N sections (OS, browsers, file types, HTTP
status, hosts, ...)
* a horizontal ranking bar chart for the countries section, replacing
the discontinued Flash GeoMap
Benefits over graphgooglechartapi:
* no external request, no JavaScript, no CDN, so charts keep working
offline and inside static (BuildStaticPages) reports
* no visitor data is ever sent to a third party (privacy / GDPR)
* crisp vector output with native <title> hover tooltips
* compatible with both html and xhtml BuildReportFormat
No new Perl module dependencies. graphgooglechartapi is left in place but
marked as deprecated in awstats.model.conf, where the new plugin is
documented.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
graphgooglechartapiplugin builds charts as<img>tags pointing at theGoogle Image Charts API (
chart.googleapis.com/chart?...), and the country mapvia the Google Visualization "geomap". Google shut down the Image Charts API in
March 2019, and the Flash-based GeoMap even earlier, so these charts now render
as broken images on every modern report.
Change
A new
graphsvgplugin that is a drop-in replacement: it implements the sameShowGraphhook and the same graph types, but renders everything locally asself-contained inline SVG.
month/daysofmonth/daysofweek/hours(with week-end shading and a bold "current day" label)
oss,browsers,filetypes,httpstatus,hosts, �)countries_map, replacing the discontinuedFlash GeoMap
Why SVG
inside static (
BuildStaticPages) reports<title>hover tooltipshtmlandxhtmlBuildReportFormatUsage
Replace the old plugin in your config:
graphgooglechartapiis left in place but marked deprecated inawstats.model.conf, where the new plugin is documented.Testing
perl -ccleanawstats.pl � -updatethen-outputproduces inline<svg>for all chart types and zero referencesto
chart.googleapis.comFixing -> #249