/** * 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::Image_Graph_Layout(); if (is_object($fontOptions)) { $this->_font =& $fontOptions; } else { if (is_array($fontOptions)) { $this->_fontOptions = $fontOptions; } else { $this->_fontOptions['size'] = $fontOptions; } } $this->setText($text); }
/** * 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 Image_Graph_Layout_Matrix($rows, $cols, $autoCreate = true) { parent::Image_Graph_Layout(); $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; } } } } }
/** * 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::Image_Graph_Layout(); 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); }
/** * Image_Graph_Legend [Constructor] */ function Image_Graph_Legend() { parent::Image_Graph_Layout(); $this->_padding = array('left' => 5, 'top' => 5, 'right' => 5, 'bottom' => 5); }
/** * 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) */ function Image_Graph_Plotarea($axisX = 'Image_Graph_Axis_Category', $axisY = 'Image_Graph_Axis', $direction = 'vertical') { parent::Image_Graph_Layout(); $this->_padding = 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; } }
/** * Image_Graph_Legend [Constructor] */ function Image_Graph_Legend() { parent::Image_Graph_Layout(); $this->_padding = 5; }