PHP Classes

File: sample_glassbar.php

Recommend this page to a friend!
  Packages of Tom Schaefer   QOpenFlash   sample_glassbar.php   Download  
File: sample_glassbar.php
Role: Example script
Content type: text/plain
Description: Sample GlassBar.php
Class: QOpenFlash
Display charts using Open Flash
Author: By
Last change: renaming
Date: 18 years ago
Size: 1,040 bytes
 

Contents

Class file image Download
<?php

include_once 'QOpenFlash.class.php';

// generate some random data
srand((double)microtime()*1000000);

$bar_red = new BarGlass( 55, '#D54C78', '#C31812' );
$bar_red->add('Key', '2006', 10 );

// add random height bars:
for( $i=0; $i<10; $i++ ){
  $bar_red->add(rand(2,5));
}
$bar_blue = new BarGlass( 55, '#5E83BF', '#424581' );
$bar_blue->add('Key', '2007', 10 );

for( $i=0; $i<10; $i++ ){
    $bar_blue->add(rand(5,9));
}

$g = new QChartOpenFlash();
$g    ->setTitle
        (    
            'Glass Bars', 
            '{font-size:20px; color: #bcd6ff; margin:10px; background-color: #5E83BF; padding: 5px 15px 5px 15px;}' 
        )
    ->setDataSets($bar_red, $bar_blue)
    ->setXLabels
        ( 
        array
            ( 
            'January','February','March','April',
            'May','June','July','August','September',
            'October' 
            )
        )
    ->setXAxisColor( '#909090', '#ADB5C7' )
    ->setYAxisColor( '#909090', '#ADB5C7' )
    ->setYMin( -5 )
    ->setYMax( 10 )
    ->setYSteps( 6 )
    ->setYLegend( 'Open Flash Chart', 12, '#736AFF' );
    
echo $g->render();
?>