PHP Classes
elePHPant
Icontem

File: sample_ryon.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  >  QGoogle Chart  >  sample_ryon.php  >  Download  
File: sample_ryon.php
Role: Example script
Content type: text/plain
Description: Resampled from GoogleGraph Class written by Ryon Sherman
Class: QGoogle Chart
Render chart images using Google Chart
Author: By
Last change: renaming
Date: 6 years ago
Size: 1,290 bytes
 

Contents

Class file image Download
<?php

require_once('GoogleChart.class.php');

$graph = new QGoogleChart();
$graph ->setSize(500, 500)
        ->
setType('bar')
        ->
setSubtype('vertical_grouped')
        ->
setTitle('This is a test')
        ->
setTitleColor('#FF0000')
        ->
setTitleSize(50)
        ->
setAxis()

        ->
setGridLines(array(20, 50, 1, 0))

        ->
setFill('chart', '#000000', 'solid')
        ->
setFill('background', '#FFFFFF', 'gradient', '#000000', 90, 0.5, 0)

        ->
setAxisLabels(array('Jan', 'July', 'Jan', 'July', 'Jan'))
        ->
setAxisLabels(array('0','100'))
        ->
setAxisLabels(array('A', 'B', 'C'))
        ->
setAxisLabels(array('2005', '2006', '2007'))

        ->
setAxisRanges(array(0, 200, 300, 400))
        ->
setAxisStyles(array(0, '#0000dd', 10))
        ->
setAxisStyles(array(3, '#0000dd', 12, 1))

        ->
setLabelPositions(array(1, 10, 37, 75))
        ->
setLabelPositions(array(2, 0, 1, 2, 4))

        ->
setLineColors(array('#FF0000', '#00FF00', '#0000FF'))
        ->
setLineStyles(array(3, 6, 3))
        ->
setLineStyles(array(1, 1, 0))

        ->
setMarkers(array('cross', '#FF0000', 0, 1, 20))
        ->
setMarkers(array('diamond', '#80C65A', 0, 2, 20))
   
        ->
addData(array(5, 10, 58, 95))
        ->
addData(array(5, 30, 8, 63))
        ->
addData(array(3, 17, 90, 4))

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