Re: extending/using Image_Graph

From: Date: Sat, 17 Jun 2006 16:41:15 +0000
Subject: Re: extending/using Image_Graph
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-24404@lists.php.net to get a copy of this message
On 6/16/06, dave <dave@dtracorp.com> wrote:
hi 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));
        // 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');
|
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(...) {
     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');
-- Justin Patrin

« previous php.pear.general (#24404) next »