Charts - Bar Charts Menu - 2 Bars in one chart
Make a glass bar chart.
Just keep making more bar objects and add them all to the chart.
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/bar-2-bars.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/bar-2-bars.php
<?php
include '../php-ofc-library/open-flash-chart.php';
$title = new title( date("D M d Y") );
$data = array(9,8,7,6,5,4,3,2,1); $bar = new bar_glass(); $bar->colour( '#BF3B69'); $bar->key('Last year', 12); $bar->set_values( $data );
$data2 = array(10,9,8,7,6,5,4,3,2); $bar2 = new bar_glass(); $bar2->colour( '#5E0722' ); $bar2->key('This year', 12); $bar2->set_values( $data2 );
$chart = new open_flash_chart(); $chart->set_title( $title ); $chart->add_element( $bar ); $chart->add_element( $bar2 );
echo $chart->toString();
|
Adverts:
|