?
Open Flash Chart, is open source. It is free to use and you get the source code to fiddle with!
http://teethgrinder.co.uk/open-flash-chart
Sample code
chart page
<SCRIPT LANGUAGE="JavaScript">
<!--
function reload_compare()
{
tmp = findSWF("chart");
x = tmp.reload();
x = tmp.reload("chat_data.php");
x = tmp.reload("chat_data.php", false);
}
function findSWF(movieName) {
if (navigator.appName.indexOf("Microsoft")!= -1) {
return window["ie_" + movieName];
} else {
return document[movieName];
}
}
//–>
</SCRIPT>
<BODY>
<?php
require_once 'lib/open_flash_chart_object.php';
require_once 'lib/open-flash-chart.php';
open_flash_chart_object(500,300,'chart_data.php',false,'lib/');
?>
<br>
<br>
<INPUT TYPE="button" onClick="reload_compare();" value="โหลดข้อมูลใหม่">
</object>
</BODY>
?>
data page
<?php
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
include_once( 'lib/open-flash-chart.php' );
srand((double)microtime()*1000000);
$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;}' );
//$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( 'Jan','Feb','Mar','April','May','June','July','Aug'
,'Sep','Oct'));
$g->set_y_max( 10 );
$g->y_label_steps( 5 );
$g->bg_colour = '#FFFF99';
$g->set_inner_background( '#E3F0FD', '#CBD7E6', 90 );
$g->set_y_legend( 'Open Flash Chart', 12, '#736AFF' );
echo $g->render();
?>
Statistics