Md. Golam Rabbany

Just work with honesty, Success will come on your door

Flash Chart Integrate With CodeIgniter

1. a swf file
2. a helper file
3. a library file
4. a controller

SWF File:
Download the file and past it root folder like http://localhost/your_folder

Helper File:
Download the helper file and past it root folder like http://localhost/your_folder/system/helpers

Library File:
Download the library file and past it root folder like http://localhost/your_folder/system/libraries

Controller File:

create a controller name Welcome and past the code:


class Welcome extends Controller {

function Welcome()

function index()

$base_url = site_url(‘Welcome/flash_data’);
open_flash_chart_object( 500, 250, $base_url, false );


function flash_data()



$bar_red = new bar_3d( 75, ‘#D54C78’ );
$bar_red->key( ‘2006’, 10 );

// add random height bars:
for( $i=0; $i<10; $i++ )
$bar_red->data[] = rand(2,5);

// create a 2nd set of bars:
$bar_blue = new bar_3d( 75, ‘#3334AD’ );
$bar_blue->key( ‘2007’, 10 );

// add random height bars:
for( $i=0; $i<10; $i++ )
$bar_blue->data[] = rand(5,9);

// create the graph object:
$g = new graph();
$g->title( ‘3D Bar Chart’, ‘{font-size:20px; color: #FFFFFF; margin: 5px; background-color: #505050; padding:5px; padding-left: 20px; padding-right: 20px;}’ );

//$g->set_data( $data_1 );
//$g->bar_3D( 75, ‘#D54C78’, ‘2006’, 10 );

//$g->set_data( $data_2 );
//$g->bar_3D( 75, ‘#3334AD’, ‘2007’, 10 );

$g->data_sets[] = $bar_red;
$g->data_sets[] = $bar_blue;

$g->set_x_axis_3d( 12 );
$g->x_axis_colour( ‘#909090’, ‘#ADB5C7’ );
$g->y_axis_colour( ‘#909090’, ‘#ADB5C7’ );

$g->set_x_labels( array( ‘January,February,March,April,May,June,July,August,September,October’ ) );
$g->set_y_max( 10 );
$g->y_label_steps( 5 );
$g->set_y_legend( ‘Open Flash Chart’, 12, ‘#736AFF’ );
echo $g->render();



Now run your graph : hrrp://loclahost/your_folder/ and out put like this
Grpah Image

if your want to know more about this graph please visit: http://


3 responses to “Flash Chart Integrate With CodeIgniter

  1. Jahadul Islam January 17, 2008 at 7:26 am

    very nice

  2. nelson May 15, 2009 at 1:28 am

    I still can’t run. Output error.
    It don’t display chart.
    My error: This is the URL that I tried to open:../../data-files/menu.txt
    Help me

  3. January 7, 2010 at 1:44 am

    Hi im looking for a sample on how to integrate flash+codeigniter+xml+mysql i have this given exercise where i can customize a character using flash… now i dont have any idea on how to integrate php code to flash…


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: