diff --git a/share/templates/statistics/list.tt b/share/templates/statistics/list.tt
index 6b84f195e4..9a9939b7a7 100644
--- a/share/templates/statistics/list.tt
+++ b/share/templates/statistics/list.tt
@@ -40,7 +40,7 @@
[% even = 0 %]
[% FOREACH item IN plotdata %]
[% item.title %]
- 
loading...
+ 
loading...
[% END %]
@@ -95,7 +95,7 @@
[% FOREACH url IN item.url %]
"[% url %]",
[% END %]
- ], "plot_[% item.name %]", [% item.si ? "true" : "false" %]);
+ ], "plot_[% item.name | replace('[^a-zA-Z0-9_]+', '_') %]", [% item.si ? "true" : "false" %]);
[% END %]