Login   Register  
PHP Classes
elePHPant
Icontem

File: demos/005.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Tom Schaefer  >  d3Google  >  demos/005.php  >  Download  
File: demos/005.php
Role: Example script
Content type: text/plain
Description: fill data tables with data
Class: d3Google
Generate JavaScript to show Google charts and maps
Author: By
Last change:
Date: 1 year ago
Size: 1,477 bytes
 

Contents

Class file image Download
<pre><?php 

include_once '../d3.classes.inc.php';
include_once 
'../google.classes.inc.php';
include_once 
'../element.php';

$employees = array(
    array(
"Mike", new Date(2008128)),
    array(
"Bob", new Date(200751)),
    array(
"Alice", new Date(2006716)),
    array(
"Frank", new Date(20071128)),
    array(
"Floyd", new Date(2005313)),
    array(
"Fritz", new Date(200792)),
);

$data google()->visualization->DataTable()->createVar("data");
stack()->add($data);
stack()->add(google(true$data->getVar())->addColumn("string""Employee Name"));
stack()->add(google(true$data->getVar())->addColumn("date""Start Date"));
stack()->add(google(true$data->getVar())->addRows(6));

foreach(
$employees as $index => $employee) {
    
stack()->add(google(true$data->getVar())->setCell($index0$employee[0]));
    
stack()->add(google(true$data->getVar())->setCell($index1$employee[1]));
}



$view google()->visualization->DataView($data->getVar())->createVar("view");
stack()->add($view);

$filter google(false$view->getVar())
        ->
getFilteredRows(array(array("column" => 1"minValue" => new Date(200701) ) ) );

stack()->addgoogle(true$view->getVar())->setRows($filter) );

$table google()->visualization->Table(document()->getElementById("test_dataview"))->createVar("table");
stack()->add($table);
stack()->add(google(true$table->getVar())->draw($view->getVar(), array("sortColumn" => 1)));

echo 
stack();