Warning this is an old version.

Take me to the latest version

Charts - Bar Charts Menu - Advanced Bar Chart

Make a bar chart.

See bar chart for details on the bar object.

This example shows how to use the bar_value object and the null value.

This goes into the <head> of the page:

<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">

swfobject.embedSWF(
"open-flash-chart.swf", "my_chart",
"550", "200", "9.0.0", "expressInstall.swf",
{"data-file":"gallery/adv-bar.php"} );

</script>
This writes the chart into a div with id="my_chart", right click and view source to see it in action, [the tutorials have more details]

gallery/adv-bar.php
<?php

include '../php-ofc-library/open-flash-chart.php';

$data_1 = array();

$data_1[] = 3;
$data_1[] = 8;
$data_1[] = 2;
$data_1[] = new bar_value(7);
$tmp = new bar_value(3);
$tmp->set_colour'#000000' );
$tmp->set_tooltip'BLACK BAR<br>#top#' );
$data_1[] = $tmp;
$data_1[] = null;
$data_1[] = 5;

$bar = new bar();
$bar->set_values$data_1 );
$bar->set_tooltip'Blue bar<br>Value:#val#' );

$data_2 = array();
$data_2[] = 4;
$data_2[] = 9;
$data_2[] = 8;
$data_2[] = 4;
$data_2[] = 1;
$data_2[] = 6;
$data_2[] = 3;

$bar_2 = new bar();
$bar_2->set_values$data_2 );
$bar_2->set_colour'#FFEF3F' );
$bar_2->set_tooltip'Yello bar<br>Value:#val#' );

$chart = new open_flash_chart();
$chart->set_title( new titledate("D M d Y") ) );
$chart->add_element$bar );
$chart->add_element$bar_2 );
$chart->set_bg_colour'#FFFFFF' );

echo 
$chart->toPrettyString();
To see the data produced : gallery/adv-bar.php, then 'view source'.
Support This Project
Adverts:


Open Flash Chart logo by numb.me.uk. | Syntax highlights are by GeSHi