Open Flash Chart
Support This Project :: Home - Gallery - Width and Height
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 - Width and Height

Both width and height are measured in pixels, example one is 200px wide by 400px high.

Pass the width and height into the open_flash_chart_object() function. This takes care of building the flash object HTML code.

Create the flash object
include_once 'ofc-library/open_flash_chart_object.php';
open_flash_chart_object200400'http://'$_SERVER['SERVER_NAME'] .'/open-flash-chart/gallery-data-1.php' );

Example 2, wide and short.

This chart has width=100%, this is dynamic so as you resize the browser window, the chart resizes as well.

width=100% is ideal when catering for lots of different people who may have different screen resolutions.

We pass in width '100%' and height 200px

Create the flash object
include_once 'ofc-library/open_flash_chart_object.php';
// width: 500, height: 200
// measurement is in pixels
open_flash_chart_object'100%'200'http://'$_SERVER['SERVER_NAME'] .'/open-flash-chart/gallery-data-1.php' );

This is the data file used in both examples:


// generate some random data

$max 20;
$tmp = array();
$i=0$i<9$i++ )
$tmp[] = rand(0,$max);

'ofc-library/open-flash-chart.php' );
$g = new graph();
$g->set_data$tmp );
$g->set_x_labels$tmp );
$g->title'Size Example''{font-size: 15px}' );

To see the data produced : gallery-data-1.php, then 'view source'.
Help support the project: Support This Project