Source for file piechart1.php
Documentation is available at piechart1.php
include 'Image/Graph.php';
$Font = & $Graph->addNew ('ttf_font', 'Gothic');
// set the font size to 7 pixels
$Legend->setPlotarea ($Plotarea);
// create the 1st dataset
$Dataset1->addPoint ('Beef', rand(1 , 10 ));
$Dataset1->addPoint ('Pork', rand(1 , 10 ));
$Dataset1->addPoint ('Poultry', rand(1 , 10 ));
$Dataset1->addPoint ('Camels', rand(1 , 10 ));
$Dataset1->addPoint ('Other', rand(1 , 10 ));
// create the 1st plot as smoothed area chart using the 1st dataset
$Plot = & $Plotarea->addNew ('pie', &$Dataset1);
// create a Y data value marker
// create a pin-point marker type
$PointingMarker = & $Plot->addNew ('Image_Graph_Marker_Pointing_Angular', array (20 , &$Marker));
// and use the marker on the 1st plot
$Plot->setMarker ($PointingMarker);
// format value marker labels as percentage values
$Marker->setDataPreprocessor (Image_Graph::factory('Image_Graph_DataPreprocessor_Formatted', '%0.1f%%'));
$Plot->setFillStyle ($FillArray);
Documentation generated on Mon, 11 Mar 2019 14:24:57 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|