コード例 #1
0
 /**
  * HorizontalLayout [Constructor]
  * @param Image_Graph_Element $part1 The 1st part of the layout
  * @param Image_Graph_Element $part2 The 2nd part of the layout
  * @param int $percentage The percentage of the layout to split at
  */
 function &Image_Graph_Layout_Horizontal(& $part1, & $part2, $percentage = 50)
 {
     parent::__construct();
     $this->_part1 = & $part1;
     $this->_part2 = & $part2;
     $this->add($this->_part1);
     $this->add($this->_part2);
     $this->_percentage = max(0, min(100, $percentage));
     $this->_split();
     $this->_padding = 0;
 }
コード例 #2
0
ファイル: Title.php プロジェクト: casati-dolibarr/corebos
 /**
  * Create the title.
  *
  * Pass a Image_Graph_Font object - preferably by-ref (&) as second
  * parameter, the font size in pixels or an associated array with some or
  * all of the followin keys:
  *
  * 'size' The size of the title
  *
  * 'angle' The angle at which to write the title (in degrees or 'vertical')
  *
  * 'color' The font-face color
  *
  * @param sting $text        The text to represent the title
  * @param mixed $fontOptions The font to use in the title
  */
 function Image_Graph_Title($text, $fontOptions = false)
 {
     parent::__construct();
     if (is_object($fontOptions)) {
         $this->_font =& $fontOptions;
     } else {
         if (is_array($fontOptions)) {
             $this->_fontOptions = $fontOptions;
         } else {
             $this->_fontOptions['size'] = $fontOptions;
         }
     }
     $this->setText($text);
 }
コード例 #3
0
 /**
  * Image_Graph_Layout_Matrix [Constructor]
  *
  * @param int $rows The number of rows
  * @param int $cols The number of cols
  * @param bool $autoCreate Specifies whether the matrix should automatically
  *   be filled with newly created Image_Graph_Plotares objects, or they will
  *   be added manually
  */
 function __construct($rows, $cols, $autoCreate = true)
 {
     parent::__construct();
     $this->_rows = $rows;
     $this->_cols = $cols;
     if ($this->_rows > 0 && $this->_cols > 0) {
         $this->_matrix = array(array());
         for ($i = 0; $i < $this->_rows; $i++) {
             for ($j = 0; $j < $this->_cols; $j++) {
                 if ($autoCreate) {
                     $this->_matrix[$i][$j] =& $this->addNew('plotarea');
                     $this->_pushEdges($i, $j);
                 } else {
                     $this->_matrix[$i][$j] = false;
                 }
             }
         }
     }
 }
コード例 #4
0
ファイル: Plotarea.php プロジェクト: hungnv0789/vhtm
 /**
  * PlotareaLayout [Constructor]
  * @param string $title The plotarea title
  * @param string $axisXTitle The title displayed on the X-axis (i.e. at the bottom)
  * @param string $axisYTitle The title displayed on the Y-axis (i.e. on the left - vertically)
  */
 function &Image_Graph_Layout_Plotarea($title, $axisXTitle, $axisYTitle)
 {
     parent::__construct();
     
     $this->_plotarea = & new Image_Graph_Plotarea();
     
     return
         new Image_Graph_Layout_Horizontal(
             new Image_Graph_Title($title, $GLOBALS['_Image_Graph_font']),        
             new Image_Graph_Layout_Vertical(
                 new Image_Graph_Title($axisYTitle, $GLOBALS['_Image_Graph_vertical_font']),
                 new Image_Graph_Layout_Horizontal(
                     $this->_plotarea,
                     new Image_Graph_Title($axisXTitle, $GLOBALS['_Image_Graph_font']),
                     95
                 ),
                 5
             ),
             10
         );
 }
コード例 #5
0
 /**
  * HorizontalLayout [Constructor]
  *
  * @param Image_Graph_Element $part1 The 1st part of the layout
  * @param Image_Graph_Element $part2 The 2nd part of the layout
  * @param int $percentage The percentage of the layout to split at
  */
 function __construct(&$part1, &$part2, $percentage = 50)
 {
     parent::__construct();
     if (!is_a($part1, 'Image_Graph_Layout')) {
         $this->_error('Cannot create layout on non-layouable parts: ' . get_class($part1), array('part1' => &$part1, 'part2' => &$part2));
     } elseif (!is_a($part2, 'Image_Graph_Layout')) {
         $this->_error('Cannot create layout on non-layouable parts: ' . get_class($part2), array('part1' => &$part1, 'part2' => &$part2));
     } else {
         $this->_part1 =& $part1;
         $this->_part2 =& $part2;
         $this->add($this->_part1);
         $this->add($this->_part2);
     }
     if ($percentage === 'auto') {
         $this->_percentage = false;
         $this->_absolute = 'runtime';
     } else {
         $this->_absolute = false;
         $this->_percentage = max(0, min(100, $percentage));
     }
     $this->_split();
     $this->_padding = array('left' => 0, 'top' => 0, 'right' => 0, 'bottom' => 0);
 }
コード例 #6
0
 /**
  * Image_Graph_Plotarea [Constructor]
  *
  * @param string $axisX     The class of the X axis (if omitted a std. axis is created)
  * @param string $axisY     The class of the Y axis (if omitted a std. axis is created)
  * @param string $direction The direction of the plotarea - 'horizontal' or 'vertical' (default)
  *
  * @return void
  */
 function Image_Graph_Plotarea($axisX = 'Image_Graph_Axis_Category', $axisY = 'Image_Graph_Axis', $direction = 'vertical')
 {
     parent::__construct();
     $this->_padding = array('left' => 5, 'top' => 5, 'right' => 5, 'bottom' => 5);
     include_once 'Image/Graph.php';
     $this->_axisX =& Image_Graph::factory($axisX, IMAGE_GRAPH_AXIS_X);
     $this->_axisX->_setParent($this);
     $this->_axisY =& Image_Graph::factory($axisY, IMAGE_GRAPH_AXIS_Y);
     $this->_axisY->_setParent($this);
     $this->_axisY->_setMinimum(0);
     $this->_fillStyle = false;
     if ($direction == 'horizontal') {
         $this->_horizontal = true;
         $this->_axisX->_transpose = true;
         $this->_axisY->_transpose = true;
     }
 }
コード例 #7
0
ファイル: Legend.php プロジェクト: ballistiq/revive-adserver
 /**
  * Image_Graph_Legend [Constructor]
  */
 function Image_Graph_Legend()
 {
     parent::__construct();
     $this->_padding = array('left' => 5, 'top' => 5, 'right' => 5, 'bottom' => 5);
 }
コード例 #8
0
    /**
     * Image_Graph_Plotarea [Constructor]
     * @param Image_Graph_Axis $axisX The X axis (if false or omitted a std. axis is created)
     * @param Image_Graph_Axis $axisY The Y axis (if false or omitted a std. axis is created)
     */
    function &Image_Graph_Plotarea($axisX = false, $axisY = false)
    {
        parent::__construct();       
        
        $this->_padding = 10;
    
        if (($axisX == null) and ($axisX !== false)) {
            $this->_axisX = null;
        }
        elseif ($axisX !== false) {
            $this->_axisX = & $axisX;
        } else {
            $this->_axisX = & new Image_Graph_Axis(IMAGE_GRAPH_AXIS_X);
        }
        if (is_object($this->_axisX)) {
            $this->_axisX->_setParent($this);
        }

        if (($axisY == null) and ($axisY !== false)) {
            $this->_axisY = null;
        } 
        elseif ($axisY !== false) {
            $this->_axisY = & $axisY;
        } else {
            $this->_axisY = & new Image_Graph_Axis(IMAGE_GRAPH_AXIS_Y);
        }
        if (is_object($this->_axisY)) {
            $this->_axisY->_setParent($this);
            $this->_axisY->_setMinimum(0);
        }
    }
コード例 #9
0
 /**
  * Create the title
  * @param sting $text The text to represent the title
  * @param Font $font The font to use in the title
  */
 function &Image_Graph_Title($text, & $font)
 {
     parent::__construct();
     $this->_font = & $font;
     $this->setText($text);
 }
コード例 #10
0
ファイル: Legend.php プロジェクト: hostinger/revive-adserver
 /**
  * Image_Graph_Legend [Constructor]
  */
 function __construct()
 {
     parent::__construct();
     $this->_padding = array('left' => 5, 'top' => 5, 'right' => 5, 'bottom' => 5);
 }