Open Flash Chart
Support This Project :: Home - Gallery - Bar Chart Glass
Info: Open Flash Chart 2 is out. Version 1.x and these pages will never disappear and the charts will continue working forever, but further development on 1.x has stopped. Take a look at version 2 here Open Flash Chart 2.

Gallery - Bar Chart Glass

We at Open flash Chart always strive to make things easy for ourselves. So glass bars have almost the same parameters as the bar method. The glass effect is created by drawing a semi-transparent white overlay ontop of the rounded bar.

Object: bar_glass()

bar_glass( integer $alpha, string $colour, string $outline_colour )

See the bar object for details. The only interesting parameter is $outline_colour, this is the outline colour of the bar. Choose a colour a little darker than the fill colour to make the bar look like it has some depth.

Create the flash object
<?php
include_once 'ofc-library/open_flash_chart_object.php';
open_flash_chart_object750260'http://'$_SERVER['SERVER_NAME'] .'/open-flash-chart/gallery-data-34.php' );
?>
gallery-data-34.php
<?php

include_once( 'ofc-library/open-flash-chart.php' );

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


$bar_1 = new bar_glass55'#D54C78''#C31812' );
$bar_1->key'2006'10 );

// add 10 bars with random heights
for( $i=0$i<10$i++ )
  
$bar_1->data[] = rand(2,5);


//
// create a 2nd set of bars:
//
$bar_2 = new bar_glass55'#5E83BF''#424581' );
$bar_2->key'2007'10 );

// make 10 bars of random heights
for( $i=0$i<10$i++ )
  
$bar_2->data[] = rand(-5,9);


//
// create the chart:
//
$g = new graph();
$g->title'Glass Bars''{font-size:20px; color: #bcd6ff; margin:10px; background-color: #5E83BF; padding: 5px 15px 5px 15px;}' );

// add both sets of bars:
$g->data_sets[] = $bar_1;
$g->data_sets[] = $bar_2;

// label the X axis (10 labels for 10 bars):
$g->set_x_labels( array( 'January','February','March','April','May','June','July','August','September','October' ) );

// colour the chart to make it pretty:
$g->x_axis_colour'#909090''#D2D2FB' );
$g->y_axis_colour'#909090''#D2D2FB' );

$g->set_y_min( -);
$g->set_y_max10 );
$g->y_label_steps);
$g->set_y_legend'Open Flash Chart'12'#736AFF' );
echo 
$g->render();
?>
To see the data produced : gallery-data-34.php, then 'view source'.
Help support the project: Support This Project

Adverts: