/** * Create the plotarea, implicitely creates 2 normal axis */ function __construct() { parent::__construct(); $this->_padding = array('left' => 10, 'top' => 10, 'right' => 10, 'bottom' => 10); $this->_axisX =& Image_Graph::factory('Image_Graph_Axis_Radar'); $this->_axisX->_setParent($this); $this->_axisY =& Image_Graph::factory('Image_Graph_Axis', IMAGE_GRAPH_AXIS_Y); $this->_axisY->_setParent($this); $this->_axisY->_setMinimum(0); }
/** * Create the plotarea, implicitely creates 2 normal axis */ function Image_Graph_Plotarea_Radar() { parent::Image_Graph_Element(); $this->_padding = 10; $this->_axisX =& Image_Graph::factory('Image_Graph_Axis_Radar'); $this->_axisX->_setParent($this); $this->_axisY =& Image_Graph::factory('Image_Graph_Axis', IMAGE_GRAPH_AXIS_Y); $this->_axisY->_setParent($this); $this->_axisY->_setMinimum(0); }
/** * Update coordinates * * @return void * @access private */ function _updateCoords() { parent::_updateCoords(); $mapAspectRatio = $this->_mapSize['X'] / $this->_mapSize['Y']; $plotAspectRatio = ($width = $this->_fillWidth()) / ($height = $this->_fillHeight()); $scaleFactorX = $mapAspectRatio > $plotAspectRatio; if ($this->_mapSize['X'] <= $width && $this->_mapSize['Y'] <= $height || $this->_mapSize['X'] >= $width && $this->_mapSize['Y'] >= $height) { if ($scaleFactorX) { $this->_scale = $width / $this->_mapSize['X']; } else { $this->_scale = $height / $this->_mapSize['Y']; } } elseif ($this->_mapSize['X'] < $width) { $this->_scale = $height / $this->_mapSize['Y']; } elseif ($this->_mapSize['Y'] < $height) { $this->_scale = $width / $this->_mapSize['X']; } $this->_plotLeft = ($this->_fillLeft() + $this->_fillRight() - $this->_mapSize['X'] * $this->_scale) / 2; $this->_plotTop = ($this->_fillTop() + $this->_fillBottom() - $this->_mapSize['Y'] * $this->_scale) / 2; $this->_plotRight = ($this->_fillLeft() + $this->_fillRight() + $this->_mapSize['X'] * $this->_scale) / 2; $this->_plotBottom = ($this->_fillTop() + $this->_fillBottom() + $this->_mapSize['Y'] * $this->_scale) / 2; }