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
<?php include_once 'ofc-library/open_flash_chart_object.php'; open_flash_chart_object( 200, 400, '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
<?php 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:
gallery-data-1.php
<?php
// generate some random data srand((double)microtime()*1000000);
$max = 20; $tmp = array(); for( $i=0; $i<9; $i++ ) { $tmp[] = rand(0,$max); }
include_once( '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}' ); echo $g->render(); ?>
|