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

Source for file AxisLabelsItems.php

Documentation is available at AxisLabelsItems.php

  1. <?php
  2.  
  3.  /**
  4.  * AxisLabelsItems class
  5.  *
  6.  * Description: Custom labels list
  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 axis
  13.  * @link http://www.steema.com
  14.  */
  15.  
  16.  class AxisLabelsItems extends ArrayObject {
  17.  
  18.     protected $iAxis;
  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 AxisLabelsItems($a{
  39.         parent::__construct();
  40.         $this->iAxis = $a;
  41.     }
  42.  
  43.     /**
  44.     * Accesses indexed Label characteristics
  45.     *
  46.     * @param index int
  47.     * @return AxisLabelItem 
  48.     */
  49.     public function getItem($index{
  50.         return $this->offsetget($index);
  51.     }
  52.  
  53.     /**
  54.     * Adds new label
  55.     *
  56.     * @param value double The axis data value
  57.     * @return  new AxisLabelItem
  58.     */
  59.     public function add($value$text=null{
  60.  
  61.         $result new AxisLabelItem($this->iAxis->chart);
  62.         $result->iAxisLabelsItems $this;
  63.         $result->setTransparent(true);
  64.         $result->setValue($value);
  65.  
  66.         parent::append($result);
  67.  
  68.         if ($text != null{
  69.           $result->setText($text);
  70.         }
  71.         return $result;
  72.     }
  73.  
  74.     public function copyFrom($source{
  75.         $this->clear();
  76.  
  77.         for $t 0$t sizeof($source)$t++{
  78.             $this->offsetset($source->getItem($t)->getValue()$source->getItem($t)->getText());
  79.         }
  80.     }
  81.  
  82.     /**
  83.     * Clears custom labels list
  84.     *
  85.     */
  86.     public function clear({
  87.         unset($this);
  88.         $this->iAxis->chart->invalidate();
  89.     }
  90. }
  91. ?>

Documentation generated on Wed, 16 Jun 2010 12:03:15 +0200 by phpDocumentor 1.4.1