Charts - Pie Charts - Pie Chart Labels
Colours from maandag
The labels try to find some space to display themselves. Thanks to dz_
for this amazing patch :)
How to use javascript to resize a chart.
This goes into the <head> of the page:
<script type="text/javascript" src="js/jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-personalized-1.6rc2.min.js"></script>
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF(
"open-flash-chart.swf", "my_chart",
"100%", "100%", "9.0.0", "expressInstall.swf",
{"data-file":"gallery/pie-chart-labels.php"} );
$(document).ready(function(){
$("#resize").resizable();
});
</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-labels.php
<?php
include '../php-ofc-library/open-flash-chart.php';
$title = new title( 'Pork Pie, Mmmmm' );
$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','#D4FA00','#9E1176','#FF368D','#454545') ); $pie->set_values( array(2,3,4,new pie_value(65, "hello (6.5)"),65,2,2.5,6,5,25) );
$chart = new open_flash_chart(); $chart->set_title( $title ); $chart->add_element( $pie );
$chart->x_axis = null;
echo $chart->toPrettyString();
|
Adverts:
|