Re: extending/using Image_Graph
| From: | dave | Date: | Sun, 18 Jun 2006 02:50:55 +0000 |
| Subject: | Re: extending/using Image_Graph | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24406@lists.php.net to get a copy of this message | ||
Justin Patrin wrote:
On 6/16/06, dave <dave@dtracorp.com> wrote:-- http://dtracorp.comhi all i'm working on a project that needs to set specific labels on the y-axis to bold, and have icons next to them currently, image_graph does not provide the ability to do this for specific labels (i believe the guy is working on it, but who knows when that could be done) the issue i am having is that the whole y axis (just the labels) is drawn by a private method deep down inside a private _done method where each _done method calls it's parent::_done() method again the class is called like | | | $this->graph = Image_Graph::factory('graph', array($width, $height));Well, you specify the acis class above. Just create your own extended class and use that. class Image_Graph_Axis_SomeBold extends Image_Graph_Axis { function _drawTick(...) {// add a TrueType font $font = $this->graph->addNew('font', 'Verdana');// set the font size to 11 pixels $font->setSize(8); $this->graph->setFont($font); $plotArea = new SamplePlotArea('Image_Graph_Axis_Category', 'Image_Graph_Axis', 'horizontal');|if (some condition) { set font bold } else { set font not bold } parent::_drawTick(...);} }$plotArea = new SamplePlotArea('Image_Graph_Axis_Category', 'Image_Graph_Axis_SomeBold', 'horizontal');hmmm.. interesting, thanks, i'll have a look at that, and see what i can do