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

Comments

redndahead’s picture

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.


// 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();

redndahead’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.