TeeChartPHP
[ class tree: TeeChartPHP ] [ index: TeeChartPHP ] [ all elements ]

Source for file ExtraLegend.php

Documentation is available at ExtraLegend.php

  1. <?php
  2.  
  3. /**
  4.  * ExtraLegend class
  5.  *
  6.  * Description: ExtraLegend tool
  7.  *
  8.  * @author
  9.  * @copyright (c) 1995-2008 by Steema Software SL. All Rights Reserved. <info@steema.com>
  10.  * @version 1.0
  11.  * @package TeeChartPHP
  12.  * @subpackage tools
  13.  * @link http://www.steema.com
  14.  */
  15.  
  16.  class ExtraLegend extends ToolSeries {
  17.  
  18.     private $legend;
  19.  
  20.     // Interceptors
  21.     function __get$property {
  22.       $method ="get{$property}";
  23.       if method_exists$this$method ) ) {
  24.         return $this->$method();
  25.       }
  26.     }
  27.  
  28.     function __set $property,$value {
  29.       $method ="set{$property}";
  30.       if method_exists$this$method ) ) {
  31.         return $this->$method($value);
  32.       }
  33.     }
  34.  
  35.     /**
  36.     * The class constructor.
  37.     */
  38.     public function ExtraLegend($c=null{
  39.         parent::ToolSeries($c);
  40.     }
  41.  
  42.     /**
  43.     * Defines the Legend characteristics.
  44.     *
  45.     * @return Legend 
  46.     */
  47.     public function getLegend({
  48.         if ($this->legend == null{
  49.             $this->legend new Legend($this->chart);
  50.             $this->legend->setCustomPosition(true);
  51.             $this->legend->setLegendStyle(LegendStyle::$VALUES);
  52.         }
  53.         return $this->legend;
  54.     }
  55.  
  56.     /**
  57.     * Defines the Legend characteristics.
  58.     *
  59.     * @param value Legend
  60.     */
  61.     public function setLegend($value{
  62.         $this->legend->assign($value);
  63.     }
  64.  
  65.     public function chartEvent($ce{
  66.         parent::chartEvent($ce);
  67.         // TODO
  68.         if (/*($ce->getID()==$tmpChartDrawEvent->PAINTED) &&*/
  69.             ($ce->getDrawPart()==ChartDrawEvent::$CHART)) {
  70.             if ($this->chart != null && $this->getSeries(!= null{
  71.                 $this->getLegend()->setSeries($this->getSeries());
  72.                 if ($this->getLegend()->getVisible()) {
  73.                     $this->drawExtraLegend();
  74.                 }
  75.             }
  76.         }
  77.     }
  78.  
  79.     private function drawExtraLegend({
  80.         $rect $this->chart->getChartRect();
  81.         $tmp $this->chart->getLegend();
  82.         $this->chart->setLegend($this->getLegend());
  83.         $rect $this->chart->doDrawLegend($this->chart->getGraphics3D()$rect);
  84.         $this->chart->setLegend($tmp);
  85.     }
  86.  
  87.     /**
  88.     * Gets descriptive text.
  89.     *
  90.     * @return String 
  91.     */
  92.     public function getDescription({
  93.         return Language::getString("ExtraLegendTool");
  94.     }
  95.  
  96.     /**
  97.     * Gets detailed descriptive text.
  98.     *
  99.     * @return String 
  100.     */
  101.     public function getSummary({
  102.         return Language::getString("ExtraLegendSummary");
  103.     }
  104. }
  105. ?>

Documentation generated on Wed, 16 Jun 2010 12:05:17 +0200 by phpDocumentor 1.4.1