本文整理匯總了PHP中Dataset::_nearby方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dataset::_nearby方法的具體用法?PHP Dataset::_nearby怎麽用?PHP Dataset::_nearby使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Dataset
的用法示例。
在下文中一共展示了Dataset::_nearby方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ImageFilledRectangle
/**
* Draw a sample for use with legend
* @param int $x The x coordinate to draw the sample at
* @param int $y The y coordinate to draw the sample at
* @access private
*/
function _legendSample($x, $y, &$font)
{
if (is_a($this->_fillStyle, "Image_Graph_Fill")) {
$fillStyle = $this->_fillStyle->_getFillStyleAt($x -5, $y -5, 10, 10);
} else {
$fillStyle = $this->_getFillStyle();
}
if ($fillStyle != IMG_COLOR_TRANSPARENT) {
ImageFilledRectangle($this->_canvas(), $x -5, $y -5, $x +5, $y +5, $fillStyle);
ImageRectangle($this->_canvas(), $x -5, $y -5, $x +5, $y +5, $this->_getLineStyle());
} else {
ImageLine($this->_canvas(), $x -7, $y, $x +7, $y, $this->_getLineStyle());
}
if (($this->_marker) and ($this->_dataset)) {
$this->_dataset->_reset();
$point = $this->_dataset->_next();
$prevPoint = $this->_dataset->_nearby(-2);
$nextPoint = $this->_dataset->_nearby();
$point = $this->_getMarkerData($point, $nextPoint, $prevPoint, $i);
if (is_array($point)) {
$point['MARKER_X'] = $x;
$point['MARKER_Y'] = $y;
unset ($point['AVERAGE_Y']);
$this->_marker->_drawMarker($point['MARKER_X'], $point['MARKER_Y'], $point);
}
}
$text = new Image_Graph_Text($x + 20, $y, $this->_title, $font);
$text->setAlignment(IMAGE_GRAPH_ALIGN_CENTER_Y | IMAGE_GRAPH_ALIGN_LEFT);
$this->add($text);
$text->_done();
return array('Width' => 20+$font->width($this->_title), 'Height' => max(10, $font->height($this->_title)));
}