PHP Classes

File: demos/001.php

Recommend this page to a friend!
  Classes of Tom Schaefer   d3Google   demos/001.php   Download  
File: demos/001.php
Role: Example script
Content type: text/plain
Description: Basic Notation
Class: d3Google
Generate JavaScript to show Google charts and maps
Author: By
Last change:
Date: 11 years ago
Size: 751 bytes
 

Contents

Class file image Download
<?php

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

$init = google()
    ->
visualization
   
->ColumnChart(document()->getElementById("chart_div"));

$chart = $init->createVar("chart");
stack()->add($chart);
?>

<?php
stack
()->add( google($chart->getVar())->draw(array(1,2,3), obj(array(
   
"width" => '100%', "height" => 266,
   
"colors" => array('#c7cfc7', '#b2c8b2', '#d9e0de', '#cdded1'),
   
"chartArea" => array("left"=>38,"top"=>30, "width"=>"75%","height"=>"70%"),
   
"legendTextStyle" => array("color"=>'#666666'),
   
"hAxis"=> array("title"=> 'Year', "titleTextStyle"=> array("color"=> '#5c5c5c'),
   
"titlePosition"=> 'out'))
))
);

$html = stack();
echo
$html;