Login   Register  
PHP Classes
elePHPant
Icontem

File: Template/Gauge.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/Gauge.phtml  >  Download  
File: Template/Gauge.phtml
Role: Auxiliary script
Content type: text/plain
Description: Sample Gauge Template
Class: QGoogleVisualizationAPI 2009
Generate charts with Google Visualization API
Author: By
Last change:
Date: 5 years ago
Size: 823 bytes
 

Contents

Class file image Download
<script src="<?php echo Google_Visualization::APISCRIPT?>"></script>
<script>
var cObj = <?php echo $configObject;?>;
var dataObj = <?php echo $dataObject->getData()?>;
var dtTable;
function draw() {
  var data = new google.visualization.DataTable(dataObj);
  dtTable=data;
  var eStr = 'new '+cObj.provider+'.'+cObj.scope+'.'+cObj.type+'(document.getElementById("'+cObj.port+'"))';
  visualization = eval(eStr);
  visualization.draw(data, cObj.props);
}
function changeTemp(dir) {
   dtTable.setValue(0, 0, dtTable.getValue(0, 0) + dir * 25);
   dtTable.setValue(0, 1, dtTable.getValue(0, 1) + dir * 20);
   visualization.draw(dtTable, cObj.props);
}

google.load(cObj.scope, cObj.version,{'packages': [cObj.type.toLowerCase()], 'language':cObj.language});
google.setOnLoadCallback(draw);
</script>