Login   Register  
PHP Classes
elePHPant
Icontem

File: Template/Table_Format.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_Format.phtml  >  Download  
File: Template/Table_Format.phtml
Role: Auxiliary script
Content type: text/plain
Description: Sample Table Format Template
Class: QGoogleVisualizationAPI 2009
Generate charts with Google Visualization API
Author: By
Last change:
Date: 2009-08-30 06:25
Size: 854 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);

<?php
  
if($formatObject):
      echo 
$formatObject;
  endif;
?>

<?php if($dataViewObject):
    echo 
$dataViewObject;
?>
visualization.draw(<?php echo $dataViewObject->getViewTable()?>, cObj.props);
<?php else: ?>
visualization.draw(<?php echo $this->getDataTable()?>, cObj.props);
<?php endif; ?>
}
google.load(cObj.scope, cObj.version,{'packages': [cObj.type.toLowerCase()], 'language':cObj.language});
google.setOnLoadCallback(draw);
</script>