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.
$alpha (0-100) is the alpha of the chart. As you mouse over each slice it will fade
from $alpha to 100.
$line_colour is the HEX colour of the outline.
$style is the CSS style string of the labels. Use {display: none;} to remove the labels, the label values are
still displayed in the tooltips (see pie links for an example).
pie_values()
pie_values( array $values, array $labels )
$values is an array of integers.
$labels is an array of strings, that label each slice.
The $values will be shown as percentages as this is the traditional way of displaying pie charts. The whole chart represents 100%, and each slice is part of that.
pie_slice_colours()
pie_slice_colours( array $colours )
$colours is an array of string HEX colours. If there are more values than colours in this array, the colours will be re-used. E.g:
This sets IE to red (#FF0000), Firefox to green (#00FF00) and Opera to blue (#0000FF), because we have run out of colours Wii is set to red (#FF0000) and Other is set to green (#00FF00).
include_once( 'ofc-library/open-flash-chart.php' ); $g = new graph();
// // PIE chart, 60% alpha // $g->pie(60,'#505050','{font-size: 12px; color: #404040;'); // // pass in two arrays, one of data, the other data labels // $g->pie_values( $data, array('IE','Firefox','Opera','Wii','Other') ); // // Colours for each slice, in this case some of the colours // will be re-used (3 colurs for 5 slices means the last two // slices will have colours colour[0] and colour[1]): // $g->pie_slice_colours( array('#d01f3c','#356aa0','#C79810') );