From: Ben Klang Date: Tue, 8 Jul 2008 14:19:11 +0000 (+0000) Subject: Make graph more readable and add markers indicating the exact value X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ecc8dd7b42f238541e9dbdc4e01bf198ca0390e8;p=horde.git Make graph more readable and add markers indicating the exact value --- diff --git a/graphgen.php b/graphgen.php index 04f8528fa..46f44d1b9 100644 --- a/graphgen.php +++ b/graphgen.php @@ -1,6 +1,6 @@ * @@ -51,13 +51,15 @@ $graph->add( 5 ) ); + +$plotarea->setAxisPadding(array('top' => 20)); // make the legend use the plotarea (or implicitly it's plots) #$legend->setPlotarea($plotarea); // create a grid and assign it to the secondary Y axis $gridY2 =& $plotarea->addNew('line_grid', IMAGE_GRAPH_AXIS_Y_SECONDARY); -$gridY2->setLineColor('black'); +#$gridY2->setLineColor('black'); #$gridY2->setFillStyle( # Image_Graph::factory( # 'gradient', @@ -73,6 +75,19 @@ $plot1 =& $plotarea->addNew('bar', $dataset1); $plot1->setLineColor('black@0.5'); $plot1->setFillColor('blue@0.2'); $plot1->setTitle('Primary Axis'); + + +$marker =& $plot1->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_VALUE_Y); +// create a pin-point marker type +$PointingMarker =& $plot1->addNew('Image_Graph_Marker_Pointing', array(0, -7, $marker)); +$PointingMarker->setLineColor(false); +$marker->setBorderColor(false); +$marker->setFillColor(false); +// and use the marker on the 1st plot +$plot1->setMarker($PointingMarker); + +$marker->setDataPreProcessor(Image_Graph::factory('Image_Graph_DataPreProcessor_Formatted', '%0.1f')); +$marker->setFontSize(6.5); // create an area plot using a random dataset #$dataset2 =& Image_Graph::factory('random', array(8, 1, 10, true));