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

Source for file TeePage.php

Documentation is available at TeePage.php

  1. <?php
  2.  
  3. /**
  4.  * Page class
  5.  *
  6.  * Description: Chart paging characteristics
  7.  *
  8.  * @author
  9.  * @copyright (c) 1995-2010 by Steema Software SL. All Rights Reserved. <info@steema.com>
  10.  * @version 1.0
  11.  * @package TeeChartPHP
  12.  * @link http://www.steema.com
  13.  */
  14.  
  15. class TeePage extends TeeBase {
  16.  
  17.     private $maxPoints 0;
  18.     private $current 1;
  19.     private $scaleLast true;
  20.  
  21.     protected $changeEvent;
  22.  
  23.     // Interceptors
  24.     function __get$property {
  25.       $method ="get{$property}";
  26.       if method_exists$this$method ) ) {
  27.         return $this->$method();
  28.       }
  29.     }
  30.  
  31.     function __set $property,$value {
  32.       $method ="set{$property}";
  33.       if method_exists$this$method ) ) {
  34.         return $this->$method($value);
  35.       }
  36.     }
  37.  
  38.     /** A list of event listeners for this component. */
  39.     protected $listenerList;
  40.  
  41.     /**
  42.     * The class constructor.
  43.     */
  44.     public function TeePage($c{
  45.         parent::__construct($c);
  46.         $this->readResolve();
  47.     }
  48.  
  49.     protected function readResolve({
  50.         return $this;
  51.     }
  52.  
  53.     /**
  54.      * Gets the number of pages, according to MaxPointsPerPage property.<br>
  55.      * TChart.Page.MaxPointsPerPage must be greater than zero to activate auto
  56.      * paging. TChart.Page.Current determines the current visible page.
  57.      *
  58.      * @return number of Chart pages
  59.      */
  60.     public function getCount({
  61.         return $this->chart->getNumPages();
  62.     }
  63.  
  64.     /**
  65.      * The current page number.<br><br>
  66.      *
  67.      * Run-time only.
  68.      * TChart.Page.Current determines the current visible points of Series in
  69.      * a Chart with MaxPointsPerPage greater than zero.
  70.      * When TChart.Page.MaxPointsPerPage is greater than zero, TeeChart
  71.      * internally divides all Series points in "pages".
  72.      * Each page is assigned a different initial and ending X coordinates.
  73.      * TChart.Page.NumPages returns the total number of pages. It equals the
  74.      * total number of Series points divided by MaxPointsPerPage.
  75.      * TChart.Page.Previous and TChart.Page.Next decrement or increment
  76.      * Current respectively.
  77.      *
  78.      * @return current page number
  79.      */
  80.     public function getCurrent({
  81.         return $this->current;
  82.     }
  83.  
  84.     /**
  85.      * Sets the current page number.
  86.      *
  87.      * @param value int
  88.      */
  89.     public function setCurrent($value{
  90.         if (($value >= 0&& ($value <= $this->getCount())) {
  91.             $this->current $this->setIntegerProperty($this->current$value);
  92.         }
  93.     }
  94.  
  95.     /**
  96.      * The number of points displayed per page.<br>
  97.      * Default value: 0
  98.      *
  99.      * @return maximum number of points
  100.      */
  101.     public function getMaxPointsPerPage({
  102.         return $this->maxPoints;
  103.     }
  104.  
  105.     /**
  106.      * Sets the number of points displayed per page.<br>
  107.      * MaxPointsPerPage controls "TeeChart AutoPaging".
  108.      * Setting it to a number greater than zero makes TeeChart internally
  109.      * divide Series points in Pages. You can then navigate across Chart pages
  110.      * by using Chart.Page and Chart.NumPages.
  111.      * For each Page, TeeChart will automatically calculate and display the
  112.      * corresponding Series points. The last page can have fewer points than
  113.      * other pages. You can use the Chart.ScaleLastPage to control if last
  114.      * page will be "stretched" or not.<br>
  115.      * Default value: 0
  116.      *
  117.      * <p>Example:
  118.      * <pre><font face="Courier" size="4">
  119.      * myChart.getPage().setMaxPointsPerPage(6);
  120.      * </font></pre></p>
  121.      *
  122.      * @see Page#getMaxPointsPerPage
  123.      * @param value int
  124.      */
  125.     public function setMaxPointsPerPage($value{
  126.         $this->maxPoints $this->setIntegerProperty($this->maxPoints$value);
  127.     }
  128.  
  129.     /**
  130.      * Determines how the last Chart page will be displayed.<br>
  131.      * It only has effect when TChart.MaxPointsPerPage is greater than zero.
  132.      * When true, the last Chart page will have the same horizontal scaling as
  133.      * the other pages. When false, the last Chart page scaling will be
  134.      * adjusted based on the number of visible points on that last page.<br>
  135.      * Default value: true
  136.      *
  137.      * @return boolean 
  138.      */
  139.     public function getScaleLastPage({
  140.         return $this->scaleLast;
  141.     }
  142.  
  143.     /**
  144.      * Determines how the last Chart page will be displayed.<br>
  145.      * Default value: true
  146.      *
  147.      * @see Page#getScaleLastPage
  148.      * @param value boolean
  149.      */
  150.     public function setScaleLastPage($value{
  151.         $this->scaleLast $this->setBooleanProperty($this->scaleLast$value);
  152.     }
  153.  
  154.     /**
  155.      * Moves to next page ( Current + 1 )<br>
  156.      * When MaxPointsPerPage is greater than Zero, TeeChart automatically
  157.      * divides point values in Pages. Calling Next is the same as
  158.      * Page = Page + 1. The NumPages chart property returns the total number of
  159.      * pages.
  160.      *
  161.      */
  162.     public function next({
  163.         if (($this->maxPoints 0&& ($this->current $this->getCount())) {
  164.             $this->setCurrent($this->current 1);
  165.         }
  166.     }
  167.  
  168.     /**
  169.      * Moves to previous page ( Current - 1 )<br>
  170.      * When MaxPointsPerPage is greater than Zero, TeeChart automatically
  171.      * divides point values in Pages. Calling Previous is the same as
  172.      * Page = Page - 1 (Go back a page). The Count property returns the total
  173.      * number of pages.
  174.      *
  175.      */
  176.     public function previous({
  177.         if (($this->maxPoints 0&& ($this->current 1)) {
  178.             $this->setCurrent($this->current 1);
  179.         }
  180.     }
  181. }
  182. ?>

Documentation generated on Wed, 16 Jun 2010 12:08:37 +0200 by phpDocumentor 1.4.1