Source for file piechart1.php
Documentation is available at piechart1.php
include('Image/Graph.php');
$Graph = & Image_Graph ::factory ('graph', array (400 , 300 ));
$Arial = & $Graph->addNew ('ttf_font', 'arial.ttf');
// set the font size to 11 pixels
// add a title using the created font
Image_Graph ::factory ('title', array ('Meat Export', &$Arial)),
$Plotarea = Image_Graph ::factory ('plotarea'),
// create the 1st dataset
$Dataset1 = & Image_Graph ::factory ('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
$Plot1 = & $Plotarea->addNew ('Image_Graph_Plot_Pie', &$Dataset1);
// create a Y data value marker
$Marker = & $Plot1->addNew ('Image_Graph_Marker_Value', VALUE_X );
// create a pin-point marker type
$PointingMarker = & $Plot1->addNew ('Image_Graph_Marker_Pointing_Angular', array (20 , &$Marker));
// and use the marker on the 1st plot
$Plot1->setMarker ($PointingMarker);
// format value marker labels as percentage values
$FillArray = & Image_Graph ::factory ('Image_Graph_Fill_Array');
$Plot1->setFillStyle ($FillArray);
Documentation generated on Mon, 11 Mar 2019 13:57:46 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|