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

Gallery - Pie Chart Links

links()

pie( integer $alpha, string $line_colour, string $label_colour )
When a slice is clicked go to a URL. These can also be Javascript links.

Create the flash object
<?php
include_once 'ofc-library/open_flash_chart_object.php';
open_flash_chart_object300300'http://'$_SERVER['SERVER_NAME'] .'/open-flash-chart/gallery-data-39.php' );
?>
gallery-data-39.php
<?php

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

$data = array();
$links = array();
for( 
$i=0$i<5$i++ )
{
    
$val rand(5,15);
    
$data[] = $val;
    
$links[] = "javascript:alert('$val')";
}

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

$g->bg '#E4F0DB';
$g->pie(60,'#E4F0DB','{display:none;}',false,1);
//
// pass in two arrays, one of data, the other data labels
//
$g->pie_values$data, array('IE','Firefox','Opera','Wii','Other','Slashdot'), $links );
//
// 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') );
$g->set_tool_tip'Label: #x_label#<br>Value: #val#%&' );

$g->title'Pie Chart''{font-size:18px; color: #d01f3c}' );

echo 
$g->render();
?>
To see the data produced : gallery-data-39.php, then 'view source'.
Help support the project: Support This Project

Adverts: