PHP Classes

File: sample_barsketch.php

Recommend this page to a friend!
  Classes of Tom Schaefer   QOpenFlash   sample_barsketch.php   Download  
File: sample_barsketch.php
Role: Example script
Content type: text/plain
Description: Sketch Bar sample
Class: QOpenFlash
Display charts using Open Flash
Author: By
Last change: renaming
Date: 15 years ago
Size: 916 bytes
 

Contents

Class file image Download
<?php

include_once 'QOpenFlash.class.php';

print
"<pre>";
// generate some random data
srand((double)microtime()*1000000);

$bar_red = new BarSketch( 55, 6, '#d070ac', '#000000' );
$bar_red->add('Key', '2006', 10 );

// add random height bars:
for( $i=0; $i<10; $i++ ){
 
$bar_red->add(rand(2,9));
}
$g = new QChartOpenFlash();
$g ->setTitle( 'Sketch', '{font-size:20px; color: #ffffff; margin:10px; background-color: #d070ac; padding: 5px 15px 5px 15px;}' )
    ->
setBgColor('#FDFDFD')
    ->
setDataSets($bar_red)
    ->
setXLabelStyle( 11, '#303030', 2 )
    ->
setYLabelStyle( 11, '#303030', 2 )
    ->
setXLabels( array( 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct' ) )
    ->
setXAxisColor( '#e0e0e0', '#ADB5C7' )
    ->
setYAxisColor( '#e0e0e0', '#ADB5C7' )
    ->
setYMax( 10 )
    ->
setXTickSize( 9 )
    ->
setYSteps( 5 )
    ->
setYLegend( 'Open Flash Chart', 12, '#736AFF' );
   
echo
$g->render();
?>