PHP Classes

File: sample_sparkline.php

Recommend this page to a friend!
  Classes of Tom Schaefer   QGoogle Chart   sample_sparkline.php   Download  
File: sample_sparkline.php
Role: Example script
Content type: text/plain
Description: simple sparkline chart
Class: QGoogle Chart
Render chart images using Google Chart
Author: By
Last change: renaming
Date: 16 years ago
Size: 565 bytes
 

Contents

Class file image Download
<?php

require_once('GoogleChart.class.php');

$range = range(25,100,8);
shuffle($range);

$graph = new QGoogleChart();
$graph ->setSize(120, 88)
        ->
setType('line')
        ->
setSubtype('sparkline')
        ->
setAxis(array("x","y"))
        ->
setAxisStyles(array(0, '#000000', 7))
        ->
setAxisStyles(array(1, '#000000', 7))
        ->
setMarkers(array('spark', '#C6D9FD',1,0,5))
        ->
setMarkers(array('spark', '#4D89F9',0,0,1))
        ->
setGridLines(array(20, 50));

$graph ->addData($range)
        ->
addData($range)
        ->
render();

?><img src="<?php echo $graph->getURL()?>"/>