I am in charge of making improvements to our current graphing system. We use Pear's Image_Graph and i have made some progress as far as making it more configurable. However, we would like users to be able to choose the location of the Legend on the graph (ex. Bottom, Corner, Top, Right, ...). I'm just not sure how to do this. I have read all of the documentation and forums I could find and nothing.
I attempting setting the coordinates on the plot area and it still displays at the bottom of the graph. Any help would be greatly appreciated. I have included the portion of my code where the legend is set for reference:
// build a graph with a legend
$Graph->add(
Image_Graph::vertical(
Image_Graph::factory('title', array($this->graph_item['title'], 12)),
Image_Graph::vertical(
$Plotarea = Image_Graph::factory('plotarea'),
$Legend = Image_Graph::factory('legend'),
80
), // end inner vertical area
5
) // end outer vertical area
); // end graph add
// TODO: Set the location of the Legend
// check if we should display the legend
if (!empty($this->graph_item['display_legend']))
{
$Plotarea->_setCoords($legend_left, $legend_top, $legend_right,
$legend_bottom);
$Legend->setPlotArea($Plotarea);
} // end if we should display the legend
Thanks in advance
~ JimmyJam