Open Flash Chart
Support This Project :: Home - Javascript
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.

Show this chart in a resizable pop up window.

Note how we pass the data URL to Open Flash Chart on both pages. This page uses gallery-data-26.php to create the data file. show-popup.php uses gallery-data-25.php. gallery-data-26.php shows the same data as gallery-data-25.php, but gallery-data-26.php turns off all the fancy GUI to keep the chart clean so it is readable at a small size. gallery-data-25.php does not have the size restriction, so more GUI elements are turned on.

Both gallery-data-25.php and gallery-data-26.php are listed below.

The code for the javascript pop() function:


<script type="text/javascript">

function pop()
{
  NewWindow=window.open('show-popup.php','newWin','width=400,height=300,left=0,top=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=Yes,fullscreen=No');
  NewWindow.focus();
}

</script>

The source of show-popup.php:

<html><head></head>
<body style="margin:0px;padding: 0px;">

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
 codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" 
 id="graphx" align="middle" height="100%" width="100%">
<param name="allowScriptAccess" value="always">
<param name="movie" value="open-flash-chart.swf?data=http://teethgrinder.co.uk/open-flash-chart/gallery-data-25.php">
<param name="quality" value="high">
<param name="bgcolor" value="#FFFFFF">
<embed src="open-flash-chart.swf?data=http://teethgrinder.co.uk/open-flash-chart/gallery-data-25.php" quality="high"
 bgcolor="#FFFFFF" name="open-flash-chart" allowscriptaccess="always" type="application/x-shockwave-flash"
  pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" height="100%" width="100%" id="graph">
</object>


</body>
gallery-data-25.php
<?php

// generate some random data
srand((double)microtime()*1000000);

$data = array();
for( 
$i=0$i<24$i++ )
{
  
$data[] = rand(11,19);
}

include_once( 
'ofc-library/open-flash-chart.php' );
$g = new graph();

$g->set_data$data );
$g->line_dot36'0x9933CC''Beer money'18 );

$g->set_x_label_style10'0x9933CC'0);

$g->set_x_labels( array( 'January 07','February 07','March 07','April 07','May 07','June 07','July 07','August 07','September 07','October 07','November 07','December 07','January 08','February 08','March 08','April 08','May 08','June 08','July 08','August 08','September 08','October 08','November 08','December 08' ) );
$g->set_y_max20 );
$g->title'Profit''{font-size: 25px; color: #FF8040}' );
echo 
$g->render();
?>
To see the data produced : gallery-data-25.php, then 'view source'.
gallery-data-26.php
<?php

// generate some random data
srand((double)microtime()*1000000);

$data = array();
for( 
$i=0$i<24$i++ )
{
  
$data[] = rand(11,19);
}

include_once( 
'ofc-library/open-flash-chart.php' );
$g = new graph();

$g->set_data$data );
$g->line2'0x9933CC' );
$g->set_x_axis_steps(4);

$g->set_y_max20 );
$g->title'Profit (2007-2008)''{font-size: 18px; color: #FF8040}' );
echo 
$g->render();
?>
To see the data produced : gallery-data-26.php, then 'view source'.
Help support the project: Support This Project

Adverts: