/** * 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) { 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); }