Source for file linechart1.php
Documentation is available at linechart1.php
include('Image/Graph.php');
return floor($Value+1998 );
// create the graph as a 500 x 300 image
$Graph = & Image_Graph ::factory ('graph', array (600 , 300 ));
// create a random dataset to use for demonstrational purposes
$DataSet = & Image_Graph ::factory ('Image_Graph_Dataset_Function', array (1 , 9 , 'salaries', 9 ));
$DataSet2 = & Image_Graph ::factory ('dataset');
$DataSet2->addPoint ('CEO', 10 );
$DataSet2->addPoint ('TAP', 32 );
$DataSet2->addPoint ('TBF', 13 );
$DataSet2->addPoint ('ABC', 19 );
$DataSet2->addPoint ('QED', 26 );
$Font = & $Graph->addNew ('ttf_font', 'arial.ttf');
$VerticalFont = & $Graph->addNew ('Image_Graph_Font_Vertical');
// add a plot area in a vertical layout to display a title on top
Image_Graph ::factory ('title', array ('Annual income', &$Font)),
$Plotarea = Image_Graph ::factory ('plotarea'),
$Plotarea2 = Image_Graph ::factory ('plotarea')
// add the line plot to the plotarea
$Plot = & $Plotarea->addNew ('line', &$DataSet);
// add coins-icon as marker
$Plot->setMarker (Image_Graph ::factory ('Image_Graph_Marker_Icon', './images/coins.png'));
// make x-axis start at 0
// create a datapreprocessor to map X-values to years
$AxisX->setDataPreprocessor (Image_Graph ::factory ('Image_Graph_DataPreprocessor_Function', 'XtoYear'));
$AxisY->setDataPreprocessor (Image_Graph ::factory ('Image_Graph_DataPreprocessor_Currency', "US$"));
$Plot2 = & $Plotarea2->addNew ('Image_Graph_Plot_Pie', &$DataSet2);
$Fill = & Image_Graph ::factory ('Image_Graph_Fill_Array');
$Plot2->setFillStyle ($Fill);
$Plot2->setMarker ($Marker2);
$Marker2->setDataPreprocessor (Image_Graph ::factory ('Image_Graph_DataPreprocessor_Formatted', '%0.0f%%'));
Documentation generated on Mon, 11 Mar 2019 13:57:45 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|