Documentation for Multiple Bar Charts
placebo333 - December 14, 2007 - 09:23
| Project: | Open Flash Chart API |
| Version: | 5.x-2.4 |
| Component: | Documentation |
| Category: | support request |
| Priority: | normal |
| Assigned: | placebo333 |
| Status: | closed |
Jump to:
Description
Hi, could anybody provide me with some basic Information about using multiple Bars in the charts like the Bar Chart 2 on the Open Flah Project Page.
http://teethgrinder.co.uk/open-flash-chart/gallery-bar-2.php
Cheers

#1
As it currently stands you would have to add a second set of data. So using my bar example this would be 2 sets of data. Currently the maker of Open Flash Chart is rewriting the php api. I will work to conform with it in the future, but he likes to take it slowly. So I'm trying to get svn access so I can try working on it.
<?php
// generate some random data
srand((double)microtime()*1000000);
$data = array();
for( $i=0; $i<6; $i++ )
{
$data[] = rand(5,9);
}
$data2 = array();
for( $i=0; $i<6; $i++ )
{
$data2[] = rand(5,9);
}
$g = new open_flash_chart_api();
$g->set_title( 'Bar Chart', '{font-size: 20px;}' );
$g->set_width(200);
//
// BAR CHART:
//
$g->set_data( $data );
$g->set_data( $data2 );
$g->bar( 50, '#9933CC', '#8010A0', 'Page views', 10 );
//
// ------------------------
//
//
// X axis tweeks:
//
$g->set_x_labels( array( 'January,February,March,April,May,June' ) );
//
// set the X axis to show every 2nd label:
//
$g->set_x_label_style( 10, '#9933CC', 0, 2 );
//
// and tick every second value:
//
$g->set_x_axis_steps( 2 );
//
$g->set_y_max( 10 );
$g->set_y_label_steps( 4 );
$g->set_y_legend( 'Open Flash Chart', 12, '#736AFF' );
$g->set_bg_colour('0xDFFFDF');
echo $g->render();
?>
#2
#3
Automatically closed -- issue fixed for two weeks with no activity.