Login   Register  
PHP Classes
elePHPant
Icontem

File: Template/Table.phtml

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Tom Schaefer  >  QGoogleVisualizationAPI 2009  >  Template/Table.phtml  >  Download  
File: Template/Table.phtml
Role: Auxiliary script
Content type: text/plain
Description: Sample Table Template
Class: QGoogleVisualizationAPI 2009
Generate charts with Google Visualization API
Author: By
Last change:
Date: 2009-08-30 06:23
Size: 815 bytes
 

Contents

Class file image Download
<script src="<?php echo Google_Visualization::APISCRIPT?>"></script>
<script>
var cObj = <?php echo $configObject;?>;
function draw() {
  var dataObj = <?php echo $dataObject->getData()?>;
  var data = new google.visualization.DataTable(dataObj, 0.5);
  var eStr = 'new '+cObj.provider+'.'+cObj.scope+'.'+cObj.type+'(document.getElementById("'+cObj.port+'"))';
  visualization = eval(eStr);
  visualization.draw(data, cObj.props);  
  google.visualization.events.addListener(visualization, 'select', function() {
    var row = visualization.getSelection()[0].row;
    document.getElementById('selectedValue').innerHTML = data.getValue(row, 0);
  });
}
google.load(cObj.scope, cObj.version,{'packages': [cObj.type.toLowerCase()], 'language':cObj.language});
google.setOnLoadCallback(draw);
</script>