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 2
Add different data to the graph.
In this chart we create 3 bar objects and fill each with bars. Then we add all 3 to the chart and display them.
// // NOTE: how we are filling 3 arrays full of data, // one for each bar on the graph // for( $i=0; $i<9; $i++ ) { $bar_1->data[] = rand(2,5); $bar_2->data[] = rand(5,9); $bar_3->data[] = rand(2,9); }
// create the chart: $g = new graph(); $g->title( 'Bar Chart', '{font-size: 26px;}' );
// add the 3 bar charts to it: $g->data_sets[] = $bar_1; $g->data_sets[] = $bar_2; $g->data_sets[] = $bar_3;
// $g->set_x_labels( array( 'January','February','March','April','May','June','July','August','September' ) ); // 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 ); //