* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 * @version CVS: $Id$ * @link http://pear.php.net/package/Image_Graph */ /** * Include file Image/Graph/Marker/Pointing.php */ require_once 'Image/Graph/Marker/Pointing.php'; /** * A pointing marker in a random angle from the data * * @category Images * @package Image_Graph * @subpackage Marker * @author Jesper Veggerby * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 * @version Release: @package_version@ * @link http://pear.php.net/package/Image_Graph */ class Image_Graph_Marker_Pointing_Radial extends Image_Graph_Marker_Pointing { /** * The radius of the radial marker * @var int * @access private */ var $_radius; /** * Create an radial pointing marker, ie a marker on a defined distance from * the data * @param int $radius The 'length' of the pointer * @param Marker $markerEnd The ending marker that represents 'the head of * the pin' */ function Image_Graph_Marker_Pointing_Radial($radius, & $markerEnd) { parent::Image_Graph_Marker_Pointing(0, 0, $markerEnd); $this->_radius = $radius; } /** * 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) { $angle = pi() * rand(0, 360) / 180; $this->_deltaX = $this->_radius * cos($angle); $this->_deltaY = $this->_radius * sin($angle); parent::_drawMarker($x, $y, $values); } } ?>