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

Source for file Points.php

Documentation is available at Points.php

  1. <?php
  2.  
  3. /**
  4.   *
  5.   * <p>Title: Points class</p>
  6.   *
  7.   * <p>Description: Point Series.</p>
  8.   *
  9.   * <p>Example:
  10.   * <pre><font face="Courier" size="4">
  11.   *  pointSeries = new com.steema.teechart.styles.Points(myChart.getChart());
  12.   *  pointSeries.fillSampleValues(20);
  13.   * </font></pre></p>
  14.   *
  15.   * <p>Copyright (c) 2005-2008 by Steema Software SL. All Rights Reserved.</p>
  16.   *
  17.   * <p>Company: Steema Software SL</p>
  18.   *
  19.   */
  20.  
  21.  class Points extends CustomPoint {
  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.     public function Points($c=null{
  39.         parent::CustomPoint($c);
  40.  
  41.         if ($this->point == null{
  42.             $tmpColor new Color(0,0,0,0,true);
  43.             $this->getPointer()->setColor($tmpColor);
  44.         }
  45. // TODO  review done at bubble..        $this->getMarks()->getCallout()->setDefaultLength(0);
  46.     }
  47.  
  48.         /**
  49.           * Sets the Pen for the Point connecting Lines.
  50.           *
  51.           * @return ChartPen 
  52.           */
  53.     public function getLinePen({
  54.         return parent::getLinePen();
  55.     }
  56.  
  57.     public function getColor({
  58.         $tmpColor new Color(0,0,0,0,true);
  59.         return ($this->point == null$tmpColor $this->getPointer()->getColor();
  60.     }
  61.  
  62.     public function setColor($value{
  63.         parent::setColor($value);
  64.         $this->getPointer()->setColor($value);
  65.     }
  66.  
  67.     public function setColorEach($value{
  68.         parent::setColorEach($value);
  69.         if ($value{
  70.             $tmpColor new Color(0,0,0,0,true);
  71.             $this->point->getBrush()->setForegroundColor($tmpColor);
  72.         }
  73.     }
  74.  
  75.         /**
  76.           * Gets descriptive text.
  77.           *
  78.           * @return String 
  79.           */
  80.     public function getDescription({
  81.         return $this->Language->getString("GalleryPoint");
  82.     }
  83.  
  84.     protected function canDoExtra({
  85.         return true;
  86.     }
  87.  
  88.     public function createSubGallery($addSubChart{
  89.         parent::createSubGallery($addSubChart);
  90.  
  91.         $addSubChart->createSubChart(Language::getString("Colors"));
  92.         $addSubChart->createSubChart(Language::getString("Marks"));
  93.         $addSubChart->createSubChart(Language::getString("Hollow"));
  94.         $addSubChart->createSubChart(Language::getString("NoBorder"));
  95.         $addSubChart->createSubChart(Language::getString("Gradient"));
  96.  
  97.         if ($this->canDoExtra()) {
  98.             $addSubChart->createSubChart(Language::getString("Point2D"));
  99.             $addSubChart->createSubChart(Language::getString("Triangle"));
  100.             $addSubChart->createSubChart(Language::getString("Star"));
  101.             $addSubChart->createSubChart(Language::getString("Circle"));
  102.             $addSubChart->createSubChart(Language::getString("DownTri"));
  103.             $addSubChart->createSubChart(Language::getString("Cross"));
  104.             $addSubChart->createSubChart(Language::getString("Diamond"));
  105.         }
  106.     }
  107.  
  108.     public function setSubGallery($index{
  109.         switch ($index{
  110.         case 1:
  111.             $this->setColorEach(true);
  112.             break;
  113.         case 2:
  114.             $this->getMarks()->setVisible(true);
  115.             break;
  116.         case 3:
  117.             $this->getPointer()->getBrush()->setVisible(false);
  118.             break;
  119.         case 4:
  120.             $this->getPointer()->getPen()->setVisible(false);
  121.             break;
  122.         case 5:
  123.             $this->getPointer()->getGradient()->setVisible(true);
  124.             break;
  125.         default{
  126.             if ($this->canDoExtra()) {
  127.                 switch ($index{
  128.                 case 6:
  129.                     $this->getPointer()->setDraw3D(false);
  130.                     break;
  131.                 case 7:
  132.                     $this->getPointer()->setStyle(PointerStyle::$TRIANGLE);
  133.                     break;
  134.                 case 8:
  135.                     $this->getPointer()->setStyle(PointerStyle::$STAR);
  136.                     break;
  137.                 case 9{
  138.                     $this->getPointer()->setStyle(PointerStyle::$CIRCLE);
  139.                     $this->getPointer()->setHorizSize(8);
  140.                     $this->getPointer()->setVertSize(8);
  141.                 }
  142.                 break;
  143.                 case 10:
  144.                     $this->getPointer()->setStyle(PointerStyle::$DOWNTRIANGLE);
  145.                     break;
  146.                 case 11:
  147.                     $this->getPointer()->setStyle(PointerStyle::$CROSS);
  148.                     break;
  149.                 case 12:
  150.                     $this->getPointer()->setStyle(PointerStyle::$DIAMOND);
  151.                     break;
  152.                 default:
  153.                     break;
  154.                 }
  155.             }
  156.         }
  157.         break;
  158.         }
  159.     }
  160. }
  161.  
  162. ?>

Documentation generated on Wed, 16 Jun 2010 12:07:28 +0200 by phpDocumentor 1.4.1