Make statistics.php work with new version of graph statistics in database