Image_Graph
| From: | Kilbride, James | Date: | Wed, 14 Sep 2005 20:53:01 +0000 |
| Subject: | Image_Graph | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-20965@lists.php.net to get a copy of this message | ||
I am attempting to use Image_Graph to display a cross reference 'table'
as it were. Essentially I have a set of points where the x and y axis
are character strings. Point1 = ('Open Source','Apache'), Point2 =
('Open Source', 'Pear'), Point3 =('Proprietary',
'Microsoft').. etc. I
want to use Image_Graph_Plot_Dot to display the data with points in the
cross spots. Is this possible?(Yes i know I can do something like this
with html, I want to know if I can do it with Image_Graph). Currently
when I try to use character points for both x and y I don't get the y
axis being set correctly.
Here's the basic code I wrote:
$Graph =& Image_Graph::factory('graph', array(400, 300));
$Graph->add(
Image_Graph::vertical(
Image_Graph::factory('title', array('Data/Activity Cross
Reference Chart', 12)),
Image_Graph::vertical(
$Plotarea = Image_Graph::factory('plotarea'),
$Legend = Image_Graph::factory('legend'),
90
),
5
)
);
$Legend->setPlotarea($Plotarea);
// create the dataset
$Dataset =& Image_Graph::factory('dataset');
//Populate Dataset
$Dataset->addPoint('Apache','Open Source');
$Dataset->addPoint('Pear','Open Source');
$Dataset->addPoint('Microsoft','Proprietary');
$Plot =& $Plotarea->addNew('Image_Graph_Plot_Dot', array(&$Dataset));
$Marker =& Image_Graph::factory('Image_Graph_Marker_Cross');
$Marker->setFillColor('blue');
$Marker->setLineColor('black');
// set a line color
$Plot->setMarker($Marker);
$Plot->setTitle('Data');
$Graph->done();
Is this something that shouldn't work? Or should it and it's a bug I
need to report?
James Kilbride