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

Source for file DashStyle.php

Documentation is available at DashStyle.php

  1. <?php
  2.  
  3. /**
  4.  * DashStyle class
  5.  *
  6.  * Description: Dash styles
  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 drawing
  13.  * @link http://www.steema.com
  14.  */
  15.  
  16. class DashStyle
  17. {
  18.  
  19.    public static $SOLID 0;
  20.    public static $DOT 1;
  21.    public static $DASH 2;
  22.    public static $DASHDOT 3;
  23.    public static $DASHDOTDOT 4;
  24.  
  25.    /**
  26.    * The class constructor.
  27.    */
  28.    public function DashStyle()    {}
  29.  
  30.    public function fromValue($value)
  31.    {
  32.       switch($value)
  33.       {
  34.          case 0:
  35.             return self::$SOLID;
  36.          case 1:
  37.             return Self::$DOT;
  38.          case 2:
  39.             return self::$DASH;
  40.          case 3:
  41.             return self::$DASHDOT;
  42.          default:
  43.             return self::$DASHDOTDOT;
  44.       }
  45.    }
  46.  
  47.    /**  TODO
  48.    * Returns an array of values that determines the number of filled and
  49.    * non-filled pixels of the Pen dash.
  50.    *
  51.    * @return float[] 
  52.  
  53.    public function getDash() {
  54.    switch ($this->getValue()) {
  55.    case 1:
  56.    return new float[] {$this->dashWidth, $this->dashWidth};
  57.    case 2:
  58.    return new float[] {$this->dashWidth * 3, $this->dashWidth};
  59.    case 3:
  60.    return new float[] {$this->dashWidth * 3, $this->dashWidth, $this->dashWidth, $this->dashWidth};
  61.    case 4:
  62.    return new float[] {$this->dashWidth * 3, $this->dashWidth, $this->dashWidth, $this->dashWidth, $this->dashWidth, $this->dashWidth};
  63.    default:
  64.    return new float[] {1};
  65.    }
  66.    }
  67.    */
  68. }
  69.  
  70. ?>

Documentation generated on Wed, 16 Jun 2010 12:04:58 +0200 by phpDocumentor 1.4.1