PHP Classes

File: sample.bar.php

Recommend this page to a friend!
  Classes of Tom Schaefer   QGoogleVisualizationAPI   sample.bar.php   Download  
File: sample.bar.php
Role: Example script
Content type: text/plain
Description: Bar Chart Sample
Class: QGoogleVisualizationAPI
Google Visualization API (deprecated)
Author: By
Last change: add reference link
Date: 15 years ago
Size: 896 bytes
 

Contents

Class file image Download
<html>
<head>
</head>

<body>
<?php

//include_once '../config/config.inc.php';

include_once("config.inc.php");

$chart = new QBarchartGoogleGraph;
$chart ->addDrawProperties(
            array(
               
"title"=>'Company Performance',
               
'isStacked'=>'true',
               
"backgroundColor" => "{stroke:'black', fill:'#eee', strokeSize: 1}"
               
)
            )
        ->
addColumns(
            array(
                array(
'string', 'Year'),
                array(
'number', 'Sales'),
                array(
'number', 'Expenses')
                )
            )
        ->
setValues(
            array(
                array(
0, 0, '2004'),
                array(
0, 1, 1000),
                array(
0, 2, 400),
                array(
1, 0, '2005'),
                array(
1, 1, 1170),
                array(
1, 2, 460),
                array(
2, 0, '2006'),
                array(
2, 1, 660),
                array(
2, 2, 1120),
                array(
3, 0, '2007'),
                array(
3, 1, 1030),
                array(
3, 2, 540),
            )
        );
echo
$chart->render();

echo
$chart->getReferenceLink();

?></body>
</html>