/** * Draw the marker on the canvas * * @param int $x The X (horizontal) position (in pixels) of the marker on the canvas * @param int $y The Y (vertical) position (in pixels) of the marker on the canvas * @param array $values The values representing the data the marker 'points' to * @access private */ function _drawMarker($x, $y, $values = false) { $this->_getFillStyle(); $this->_getLineStyle(); $this->_canvas->rectangle(array('x0' => $x - $this->_size, 'y0' => $y - $this->_size, 'x1' => $x + $this->_size, 'y1' => $y + $this->_size)); parent::_drawMarker($x, $y, $values); }
/** * Draw the marker on the canvas * * @param int $x The X (horizontal) position (in pixels) of the marker on * the canvas * @param int $y The Y (vertical) position (in pixels) of the marker on the * canvas * @param array $values The values representing the data the marker 'points' * to * @access private */ function _drawMarker($x, $y, $values = false) { $this->_getFillStyle(); $this->_getLineStyle(); $this->_canvas->addVertex(array('x' => $x - $this->_size, 'y' => $y + $this->_size)); $this->_canvas->addVertex(array('x' => $x, 'y' => $y - $this->_size)); $this->_canvas->addVertex(array('x' => $x + $this->_size, 'y' => $y + $this->_size)); $this->_canvas->polygon(array('connect' => true)); parent::_drawMarker($x, $y, $values); }
/** * Draw the marker on the canvas * * @param int $x The X (horizontal) position (in pixels) of the marker on * the canvas * @param int $y The Y (vertical) position (in pixels) of the marker on the * canvas * @param array $values The values representing the data the marker 'points' * to * @access private */ function _drawMarker($x, $y, $values = false) { if (isset($values['AVERAGE_Y']) && is_a($this->_parent, 'Image_Graph_Plot')) { $point = $this->_pointXY(array('X' => $values['APX'], 'Y' => $values['AVERAGE_Y'])); $this->_getLineStyle(); $this->_canvas->line(array('x0' => $x, 'y0' => $y, 'x1' => $point['X'], 'y1' => $point['Y'])); $this->_getLineStyle(); $this->_canvas->line(array('x0' => $point['X'] - 2, 'y0' => $point['Y'], 'x1' => $point['X'] + 2, 'y1' => $point['Y'])); } parent::_drawMarker($x, $y, $values); }
/** * Draw the marker on the canvas * * @param int $x The X (horizontal) position (in pixels) of the marker on * the canvas * @param int $y The Y (vertical) position (in pixels) of the marker on the * canvas * @param array $values The values representing the data the marker 'points' to * * @return void * @access private */ function _drawMarker($x, $y, $values = false) { $this->_getFillStyle(); $this->_getLineStyle(); $dA = 2 * pi() / ($this->_size * 2); $angle = 0; while ($angle < 2 * pi()) { $this->_canvas->addVertex(array('x' => $x + $this->_size * cos($angle), 'y' => $y - $this->_size * sin($angle))); $angle += $dA; } $this->_canvas->addVertex(array('x' => $x + $this->_size * cos(0), 'y' => $y - $this->_size * sin(0))); $this->_canvas->polygon(array('connect' => true)); parent::_drawMarker($x, $y, $values); }
/** * Draw the marker on the canvas * * @param int $x The X (horizontal) position (in pixels) of the marker on * the canvas * @param int $y The Y (vertical) position (in pixels) of the marker on the * canvas * @param array $values The values representing the data the marker 'points' * to * @access private */ function _drawMarker($x, $y, $values = false) { $this->_getFillStyle(); $this->_getLineStyle(); $d = $this->_size / 5; $x = round($x); $y = round($y); $this->_canvas->addVertex(array('x' => $x, 'y' => $y - $this->_size)); $this->_canvas->addVertex(array('x' => $x + round($d), 'y' => $y - round($d))); $this->_canvas->addVertex(array('x' => $x + $this->_size, 'y' => $y - round($d))); $this->_canvas->addVertex(array('x' => $x + round(2 * $d), 'y' => $y + round($d))); $this->_canvas->addVertex(array('x' => $x + round(3 * $d), 'y' => $y + $this->_size)); $this->_canvas->addVertex(array('x' => $x, 'y' => $y + round(3 * $d))); $this->_canvas->addVertex(array('x' => $x - round(3 * $d), 'y' => $y + $this->_size)); $this->_canvas->addVertex(array('x' => $x - round(2 * $d), 'y' => $y + round($d))); $this->_canvas->addVertex(array('x' => $x - $this->_size, 'y' => $y - round($d))); $this->_canvas->addVertex(array('x' => $x - round($d), 'y' => $y - round($d))); $this->_canvas->polygon(array('connect' => true)); parent::_drawMarker($x, $y, $values); }
/** * Draw the marker on the canvas * * @param int $x The X (horizontal) position (in pixels) of the marker on * the canvas * @param int $y The Y (vertical) position (in pixels) of the marker on the * canvas * @param array $values The values representing the data the marker 'points' * to * @access private */ function _drawMarker($x, $y, $values = false) { parent::_drawMarker($x, $y, $values); if ($this->_markerStart) { $this->_markerStart->_setParent($this); $this->_markerStart->_drawMarker($x, $y, $values); } $this->_getLineStyle(); $this->_canvas->line(array('x0' => $x, 'y0' => $y, 'x1' => $x + $this->_deltaX, 'y1' => $y + $this->_deltaY)); $this->_markerEnd->_setParent($this); $this->_markerEnd->_drawMarker($x + $this->_deltaX, $y + $this->_deltaY, $values); }
/** * Draw the marker on the canvas * * @param int $x The X (horizontal) position (in pixels) of the marker on * the canvas * @param int $y The Y (vertical) position (in pixels) of the marker on the * canvas * @param array $values The values representing the data the marker 'points' * to * @access private */ function _drawMarker($x, $y, $values = false) { if ($this->_thickness > 0) { $this->_getLineStyle(); $this->_getFillStyle(); $this->_canvas->addVertex(array('x' => $x - $this->_size, 'y' => $y - $this->_thickness)); $this->_canvas->addVertex(array('x' => $x - $this->_thickness, 'y' => $y - $this->_thickness)); $this->_canvas->addVertex(array('x' => $x - $this->_thickness, 'y' => $y - $this->_size)); $this->_canvas->addVertex(array('x' => $x + $this->_thickness, 'y' => $y - $this->_size)); $this->_canvas->addVertex(array('x' => $x + $this->_thickness, 'y' => $y - $this->_thickness)); $this->_canvas->addVertex(array('x' => $x + $this->_size, 'y' => $y - $this->_thickness)); $this->_canvas->addVertex(array('x' => $x + $this->_size, 'y' => $y + $this->_thickness)); $this->_canvas->addVertex(array('x' => $x + $this->_thickness, 'y' => $y + $this->_thickness)); $this->_canvas->addVertex(array('x' => $x + $this->_thickness, 'y' => $y + $this->_size)); $this->_canvas->addVertex(array('x' => $x - $this->_thickness, 'y' => $y + $this->_size)); $this->_canvas->addVertex(array('x' => $x - $this->_thickness, 'y' => $y + $this->_thickness)); $this->_canvas->addVertex(array('x' => $x - $this->_size, 'y' => $y + $this->_thickness)); $this->_canvas->polygon(array('connect' => true)); } else { $this->_getLineStyle(); $this->_canvas->line(array('x0' => $x - $this->_size, 'y0' => $y, 'x1' => $x + $this->_size, 'y1' => $y)); $this->_getLineStyle(); $this->_canvas->line(array('x0' => $x, 'y0' => $y - $this->_size, 'x1' => $x, 'y1' => $y + $this->_size)); } parent::_drawMarker($x, $y, $values); }
/** * Draw the marker on the canvas * * @param int $x The X (horizontal) position (in pixels) of the marker on the canvas * @param int $y The Y (vertical) position (in pixels) of the marker on the canvas * @param array $values The values representing the data the marker 'points' to * @access private */ function _drawMarker($x, $y, $values = false) { if ($this->_thickness > 0) { $this->_getLineStyle(); $this->_getFillStyle(); $d1 = round(0.7071067 * $this->_size); // cos/sin(45 de>) $d2 = round(0.7071067 * $this->_thickness); // cos/sin(45 deg) $this->_canvas->addVertex(array('x' => $x - $d1 - $d2, 'y' => $y - $d1 + $d2)); $this->_canvas->addVertex(array('x' => $x - $d1 + $d2, 'y' => $y - $d1 - $d2)); $this->_canvas->addVertex(array('x' => $x, 'y' => $y - 2 * $d2)); $this->_canvas->addVertex(array('x' => $x + $d1 - $d2, 'y' => $y - $d1 - $d2)); $this->_canvas->addVertex(array('x' => $x + $d1 + $d2, 'y' => $y - $d1 + $d2)); $this->_canvas->addVertex(array('x' => $x + 2 * $d2, 'y' => $y)); $this->_canvas->addVertex(array('x' => $x + $d1 + $d2, 'y' => $y + $d1 - $d2)); $this->_canvas->addVertex(array('x' => $x + $d1 - $d2, 'y' => $y + $d1 + $d2)); $this->_canvas->addVertex(array('x' => $x, 'y' => $y + 2 * $d2)); $this->_canvas->addVertex(array('x' => $x - $d1 + $d2, 'y' => $y + $d1 + $d2)); $this->_canvas->addVertex(array('x' => $x - $d1 - $d2, 'y' => $y + $d1 - $d2)); $this->_canvas->addVertex(array('x' => $x - 2 * $d2, 'y' => $y)); $this->_canvas->polygon(array('connect' => true)); } else { $this->_getLineStyle(); $this->_canvas->line(array('x0' => $x - $this->_size, 'y0' => $y - $this->_size, 'x1' => $x + $this->_size, 'y1' => $y + $this->_size)); $this->_getLineStyle(); $this->_canvas->line(array('x0' => $x + $this->_size, 'y0' => $y - $this->_size, 'x1' => $x - $this->_size, 'y1' => $y + $this->_size)); } parent::_drawMarker($x, $y, $values); }
/** * Draw the marker on the canvas * * @param int $x The X (horizontal) position (in pixels) of the marker on * the canvas * @param int $y The Y (vertical) position (in pixels) of the marker on the * canvas * @param array $values The values representing the data the marker 'points' to * * @return void * @access private */ function _drawMarker($x, $y, $values = false) { $ID = key($this->_markers); if (!next($this->_markers)) { reset($this->_markers); } $marker =& $this->_markers[$ID]; if ($marker != null) { $marker->_drawMarker($x, $y, $values); } parent::_drawMarker($x, $y, $values); }
/** * Draw the marker on the canvas * @param int $x The X (horizontal) position (in pixels) of the marker on the canvas * @param int $y The Y (vertical) position (in pixels) of the marker on the canvas * @param array $values The values representing the data the marker "points" to * @access private */ function _drawMarker($x, $y, $values = false) { parent::_drawMarker($x, $y, $values); $value = $this->_getDisplayValue($values); if ($this->_dataPreprocessor) { $value = $this->_dataPreprocessor->_process($value); } $this->_text = new Image_Graph_Text($x, $y, $value, $this->_font); $this->_text->setAlignment(IMAGE_GRAPH_ALIGN_CENTER); $this->add($this->_text); if ($this->_fillStyle) { // Modified: Don't draw background //ImageFilledRectangle($this->_canvas(), $this->_fillLeft(), $this->_fillTop(), $this->_fillRight(), $this->_fillBottom(), $this->_getFillStyle()); } if (isset($this->_borderStyle)) { // Modified: Don't draw a border //ImageRectangle($this->_canvas(), $this->_fillLeft(), $this->_fillTop(), $this->_fillRight(), $this->_fillBottom(), $this->_getBorderStyle()); } $this->_text->_done(); }
/** * Draw the marker on the canvas * @param int $x The X (horizontal) position (in pixels) of the marker on the canvas * @param int $y The Y (vertical) position (in pixels) of the marker on the canvas * @param array $values The values representing the data the marker "points" to * @access private */ function _drawMarker($x, $y, $values = false) { if (!(list ($ID, $marker) = each($this->_markers))) { reset($this->_markers); list ($ID, $marker) = each($this->_markers); } $marker = & $this->_markers[$ID]; if ($marker != null) { $marker->_drawMarker($x, $y, $values); } parent::_drawMarker($x, $y, $values); }
/** * Draw the marker on the canvas * * @param int $x The X (horizontal) position (in pixels) of the marker on * the canvas * @param int $y The Y (vertical) position (in pixels) of the marker on the * canvas * @param array $values The values representing the data the marker 'points' * to * @access private */ function _drawMarker($x, $y, $values = false) { parent::_drawMarker($x, $y, $values); if ($this->_filename) { $this->_canvas->image(array('x' => $x, 'y' => $y, 'filename' => $this->_filename, 'alignment' => array('horizontal' => 'center', 'vertical' => 'center'))); } }
/** * Draw the outline and the axis * * @access private */ function _drawAxis() { //draw outline $this->_getLineStyle(); $this->_canvas->pieslice(array('x' => $this->_centerX, 'y' => $this->_centerY, 'rx' => $this->_radius, 'ry' => $this->_radius, 'v1' => $this->_deg_offset, 'v2' => $this->_deg_offset + $this->_deg_width, 'srx' => $this->_radius * (1 - $this->_radiusPercent / 100), 'sry' => $this->_radius * (1 - $this->_radiusPercent / 100))); //step for every 6° $step = (int) ($this->_totalY / $this->_deg_width * 6); $value = $this->_value_min; $i = 0; while ($value <= $this->_value_max) { $angle = $this->_value2angle($value); $cos = cos(deg2rad($angle)); $sin = sin(deg2rad($angle)); $point = array('Y' => $value); $point['AX'] = $cos; $point['AY'] = $sin; $point['LENGTH'] = 1; $x = $this->_centerX + $this->_radius * $cos; $y = $this->_centerY + $this->_radius * $sin; $deltaX = -$cos * $this->_tickLength; $deltaY = -$sin * $this->_tickLength; $this->_getLineStyle(); if ($i % $this->_axisTicks == 0) { $this->_canvas->line(array('x0' => $x, 'y0' => $y, 'x1' => $x + $deltaX, 'y1' => $y + $deltaY)); if ($this->_arrowMarker) { $this->_arrowMarker->_drawMarker($x + $deltaX * 1.6, $y + $deltaY * 1.6, $point); } } else { $this->_canvas->line(array('x0' => $x, 'y0' => $y, 'x1' => $x + $deltaX * 0.5, 'y1' => $y + $deltaY * 0.5)); } $i++; $value += $step; } }
/** * Draw the marker on the canvas * * @param int $x The X (horizontal) position (in pixels) of the marker on * the canvas * @param int $y The Y (vertical) position (in pixels) of the marker on the * canvas * @param array $values The values representing the data the marker 'points' * to * @access private */ function _drawMarker($x, $y, $values = false) { parent::_drawMarker($x, $y, $values); $value = $this->_getDisplayValue($values); if ($this->_dataPreprocessor) { $value = $this->_dataPreprocessor->_process($value); } if ($this->_defaultFontOptions !== false) { $this->_canvas->setFont($this->_defaultFontOptions); } else { $this->_canvas->setFont($this->_getFont()); } $width = $this->_canvas->textWidth($value); $height = $this->_canvas->textHeight($value); $offsetX = $width / 2 + $this->_padding['left']; $offsetY = $height / 2 + $this->_padding['top']; $this->_getFillStyle(); $this->_getBorderStyle(); $this->_canvas->rectangle(array('x0' => $x - $offsetX, 'y0' => $y - $offsetY, 'x1' => $x + $offsetX, 'y1' => $y + $offsetY)); $this->write($x, $y, $value, IMAGE_GRAPH_ALIGN_CENTER); }
/** * Draw the marker on the canvas * @param int $x The X (horizontal) position (in pixels) of the marker on the canvas * @param int $y The Y (vertical) position (in pixels) of the marker on the canvas * @param array $values The values representing the data the marker "points" to * @access private */ function _drawMarker($x, $y, $values = false) { parent::_drawMarker($x, $y, $values); if ($this->_markerStart) { $this->_markerStart->_drawMarker($x, $y, $values); } // Modified: Don't draw pointer if line thickness is zero if ($this->_getLineStyle() != 0) ImageLine($this->_canvas(), $x, $y, $x + $this->_deltaX, $y + $this->_deltaY, $this->_getLineStyle()); $this->_markerEnd->_drawMarker($x + $this->_deltaX, $y + $this->_deltaY, $values); }