Menu Close

Fix for Drupal 7 Views Simple Charts Shows in Preview but Not Page

We ran across this problem on an installation of Drupal 7 where when editing a view that used a simple chart, the chart would show fine in the preview but in the actual block or page view it would be empty. This is caused by an error in the javascript code for the module. Here’s how to fix the issue:

  • Go to your drupal installation under sites/all/modules/views_simplechart/views-simplechart-graph.tpl.php (obviously, sites/all is dependent on your installation)
  • Right before the line starting with google.charts.setOnLoadCallback add the following line: google.charts.load(‘current’, {‘packages’:[‘corechart’,’timeline’,’orgchart’]});
Don't wait until it's too late, call us for a free quote!Get started
+