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 - X Offset
Method: set_x_offset
set_x_offset( boolean $val )
By default this is set to true, setting it to false shifts the X axis flush to the Y Axis.
Doing this is for bar charts makes them fall off the edge of the chart, so they look and act a bit weird.
// generate some random data srand((double)microtime()*1000000);
// // NOTE: how we are filling 3 arrays full of data, // one for each line on the graph // $data_1 = array(); $data_2 = array(); $data_3 = array(); for( $i=0; $i<12; $i++ ) { $data_1[] = rand(14,19); $data_2[] = rand(8,13); $data_3[] = rand(1,7); }
include_once( 'ofc-library/open-flash-chart.php' ); $g = new graph(); $g->title( 'Many data lines', '{font-size: 20px; color: #736AFF}' );
// we add 3 sets of data: $g->set_data( $data_1 ); $g->set_data( $data_2 ); $g->set_data( $data_3 );
// we add the 3 line types and key labels $g->line( 2, '0x9933CC', 'Page views', 10 ); $g->line_dot( 3, 5, '0xCC3399', 'Downloads', 10); // <-- 3px thick + dots $g->line_hollow( 2, 4, '0x80a033', 'Bounces', 10 );