|
|
Charts - Pie Charts - Pie Chart
Documentation:
This goes into the <head> of the page:
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF(
"open-flash-chart.swf", "my_chart",
"300", "300", "9.0.0", "expressInstall.swf",
{"data-file":"gallery/pie-chart-localisation.php"} );
</script>
This writes the chart into a div with id="my_chart",
right click and view source to see it in action,
[the tutorials have more details]
gallery/pie-chart-localisation.php
<?php
include '../php-ofc-library/open-flash-chart.php';
$title = new title( 'My Pie Chart' );
$pie = new pie(); $pie->set_alpha(0.6); $pie->set_start_angle( 35 ); $pie->add_animation( new pie_fade() ); $pie->set_tooltip( '#val# of #total#<br>#percent# of 100%' ); $pie->set_colours( array('#1C9E05','#FF368D') ); $pie->set_values( array(2000,3000,4000,new pie_value(6500, "hello (#val#)")) );
$chart = new open_flash_chart(); $chart->set_title( $title ); $chart->add_element( $pie );
$chart->set_number_format(2, true, true, true );
$chart->x_axis = null;
echo $chart->toPrettyString();
|
Adverts:
|
|