Update to PEAR 1.7.2, Image_Canvas 0.3.1, Image_Color 1.0.3, Image_Graph 0.7.2, XML_Parser 1.3.1.

Removed PHP_Compat, and references to it.
Removed ionCube/Zend/mmCache compatibility checks in test.php script.
Changed minimum PHP requirement to 5.0 in test.php script.
This commit is contained in:
anubis
2009-01-04 19:22:54 -05:00
parent 60b674c776
commit fae6352bf2
384 changed files with 34150 additions and 44524 deletions

View File

@@ -1,105 +1,105 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Array.php,v 1.6 2005/02/21 20:49:50 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* A sequential array of markers.
*
* This is used for displaying different markers for datapoints on a chart.
* This is done by adding multiple markers to a MarkerArrray structure.
* The marker array will then when requested return the 'next' marker in
* sequential order. It is possible to specify ID tags to each marker, which is
* used to make sure some data uses a specific marker.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Array extends Image_Graph_Marker
{
/**
* The marker array
* @var array
* @access private
*/
var $_markers = array ();
/**
* Add a marker style to the array
*
* @param Marker $marker The marker to add
*/
function add(& $marker)
{
if (is_a($marker, 'Image_Graph_Element')) {
parent::add($marker);
}
$this->_markers[] =& $marker;
reset($this->_markers);
}
/**
* 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)
{
$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);
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Array.php,v 1.6 2005/02/21 20:49:50 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* A sequential array of markers.
*
* This is used for displaying different markers for datapoints on a chart.
* This is done by adding multiple markers to a MarkerArrray structure.
* The marker array will then when requested return the 'next' marker in
* sequential order. It is possible to specify ID tags to each marker, which is
* used to make sure some data uses a specific marker.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Array extends Image_Graph_Marker
{
/**
* The marker array
* @var array
* @access private
*/
var $_markers = array ();
/**
* Add a marker style to the array
*
* @param Marker $marker The marker to add
*/
function add(& $marker)
{
if (is_a($marker, 'Image_Graph_Element')) {
parent::add($marker);
}
$this->_markers[] =& $marker;
reset($this->_markers);
}
/**
* 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)
{
$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);
}
}
?>

View File

@@ -1,109 +1,109 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Asterisk.php,v 1.6 2005/08/03 21:21:55 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as an asterisk (*)
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Asterisk extends Image_Graph_Marker
{
/**
* 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->_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
)
);
$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);
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Asterisk.php,v 1.6 2005/08/03 21:21:55 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as an asterisk (*)
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Asterisk extends Image_Graph_Marker
{
/**
* 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->_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
)
);
$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);
}
}
?>

View File

@@ -1,91 +1,91 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Average.php,v 1.6 2005/08/03 21:21:55 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* A marker displaying the 'distance' to the datasets average value.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Average extends Image_Graph_Marker
{
/**
* 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);
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Average.php,v 1.6 2005/08/03 21:21:55 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* A marker displaying the 'distance' to the datasets average value.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Average extends Image_Graph_Marker
{
/**
* 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);
}
}
?>

View File

@@ -1,76 +1,76 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Box.php,v 1.6 2005/08/03 21:21:55 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as a box
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Box extends Image_Graph_Marker
{
/**
* 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);
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Box.php,v 1.6 2005/08/03 21:21:55 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as a box
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Box extends Image_Graph_Marker
{
/**
* 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);
}
}
?>

View File

@@ -1,91 +1,91 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Bubble.php,v 1.5 2005/02/21 20:49:50 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker/Circle.php
*/
require_once 'Image/Graph/Marker/Circle.php';
/**
* Display a circle with y-value percentage as radius (require GD2).
*
* This will display a circle centered on the datapoint with a radius calculated
* as a percentage of the maximum value. I.e. the radius depends on the y-value
* of the datapoint
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Bubble extends Image_Graph_Marker_Circle
{
/**
* The radius of the marker when 100%
* @var int
* @access private
*/
var $_size100Pct = 40;
/**
* Sets the maximum radius the marker can occupy
*
* @param int $radius The new Image_Graph_max radius
*/
function setMaxRadius($radius)
{
$this->_size100Pct = $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)
{
$this->_size = $this->_size100Pct*$values['PCT_MAX_Y']/100;
parent::_drawMarker($x, $y, $values);
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Bubble.php,v 1.5 2005/02/21 20:49:50 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker/Circle.php
*/
require_once 'Image/Graph/Marker/Circle.php';
/**
* Display a circle with y-value percentage as radius (require GD2).
*
* This will display a circle centered on the datapoint with a radius calculated
* as a percentage of the maximum value. I.e. the radius depends on the y-value
* of the datapoint
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Bubble extends Image_Graph_Marker_Circle
{
/**
* The radius of the marker when 100%
* @var int
* @access private
*/
var $_size100Pct = 40;
/**
* Sets the maximum radius the marker can occupy
*
* @param int $radius The new Image_Graph_max radius
*/
function setMaxRadius($radius)
{
$this->_size100Pct = $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)
{
$this->_size = $this->_size100Pct*$values['PCT_MAX_Y']/100;
parent::_drawMarker($x, $y, $values);
}
}
?>

View File

@@ -1,96 +1,96 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Circle.php,v 1.6 2005/08/03 21:21:54 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as circle (require GD2)
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Circle extends Image_Graph_Marker
{
/**
* The 'size' of the marker, the meaning depends on the specific Marker
* implementation
* @var int
* @access private
*/
var $_size = 10;
/**
* 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();
$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);
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Circle.php,v 1.6 2005/08/03 21:21:54 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as circle (require GD2)
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Circle extends Image_Graph_Marker
{
/**
* The 'size' of the marker, the meaning depends on the specific Marker
* implementation
* @var int
* @access private
*/
var $_size = 10;
/**
* 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();
$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);
}
}
?>

View File

@@ -1,114 +1,114 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Cross.php,v 1.7 2005/08/03 21:21:55 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as a cross.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Cross extends Image_Graph_Marker
{
/**
* The thickness of the plus in pixels (thickness is actually double this)
* @var int
* @access private
*/
var $_thickness = 2;
/**
* 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);
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Cross.php,v 1.7 2005/08/03 21:21:55 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as a cross.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Cross extends Image_Graph_Marker
{
/**
* The thickness of the plus in pixels (thickness is actually double this)
* @var int
* @access private
*/
var $_thickness = 2;
/**
* 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);
}
}
?>

View File

@@ -1,73 +1,73 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Diamond.php,v 1.6 2005/08/03 21:21:55 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as a diamond.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Diamond extends Image_Graph_Marker
{
/**
* 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->_canvas->addVertex(array('x' => $x, 'y' => $y - $this->_size));
$this->_canvas->addVertex(array('x' => $x + $this->_size, 'y' => $y));
$this->_canvas->addVertex(array('x' => $x, 'y' => $y + $this->_size));
$this->_canvas->polygon(array('connect' => true));
parent::_drawMarker($x, $y, $values);
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Diamond.php,v 1.6 2005/08/03 21:21:55 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as a diamond.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Diamond extends Image_Graph_Marker
{
/**
* 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->_canvas->addVertex(array('x' => $x, 'y' => $y - $this->_size));
$this->_canvas->addVertex(array('x' => $x + $this->_size, 'y' => $y));
$this->_canvas->addVertex(array('x' => $x, 'y' => $y + $this->_size));
$this->_canvas->polygon(array('connect' => true));
parent::_drawMarker($x, $y, $values);
}
}
?>

View File

@@ -1,133 +1,133 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Icon.php,v 1.8 2005/08/24 20:35:53 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker using an image as icon.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Icon extends Image_Graph_Marker
{
/**
* Filename of the image icon
* @var string
* @access private
*/
var $_filename;
/**
* X Point of the icon to use as data 'center'
* @var int
* @access private
*/
var $_pointX = 0;
/**
* Y Point of the icon to use as data 'center'
* @var int
* @access private
*/
var $_pointY = 0;
/**
* Create an icon marker
*
* @param string $filename The filename of the icon
* @param int $width The 'new' width of the icon if it is to be resized
* @param int $height The 'new' height of the icon if it is to be resized
*/
function Image_Graph_Marker_Icon($filename, $width = 0, $height = 0)
{
parent::Image_Graph_Marker();
$this->_filename = $filename;
}
/**
* Set the X 'center' point of the marker
*
* @param int $x The X 'center' point of the marker
*/
function setPointX($x)
{
$this->_pointX = $x;
}
/**
* Set the Y 'center' point of the marker
*
* @param int $y The Y 'center' point of the marker
*/
function setPointY($y)
{
$this->_pointY = $y;
}
/**
* 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')
)
);
}
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Icon.php,v 1.8 2005/08/24 20:35:53 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker using an image as icon.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Icon extends Image_Graph_Marker
{
/**
* Filename of the image icon
* @var string
* @access private
*/
var $_filename;
/**
* X Point of the icon to use as data 'center'
* @var int
* @access private
*/
var $_pointX = 0;
/**
* Y Point of the icon to use as data 'center'
* @var int
* @access private
*/
var $_pointY = 0;
/**
* Create an icon marker
*
* @param string $filename The filename of the icon
* @param int $width The 'new' width of the icon if it is to be resized
* @param int $height The 'new' height of the icon if it is to be resized
*/
function Image_Graph_Marker_Icon($filename, $width = 0, $height = 0)
{
parent::Image_Graph_Marker();
$this->_filename = $filename;
}
/**
* Set the X 'center' point of the marker
*
* @param int $x The X 'center' point of the marker
*/
function setPointX($x)
{
$this->_pointX = $x;
}
/**
* Set the Y 'center' point of the marker
*
* @param int $y The Y 'center' point of the marker
*/
function setPointY($y)
{
$this->_pointY = $y;
}
/**
* 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')
)
);
}
}
}
?>

View File

@@ -1,65 +1,65 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Pinpoint.php,v 1.5 2005/08/24 20:35:53 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker/Icon.php
*/
require_once 'Image/Graph/Marker/Icon.php';
/**
* Data marker using a pinpoint as marker.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Pinpoint extends Image_Graph_Marker_Icon
{
/**
* Create the marker as a pin point
*/
function Image_Graph_Marker_Pinpoint()
{
parent::Image_Graph_Marker_Icon(
dirname(__FILE__).'/../Images/Icons/pinpoint.png'
);
$this->setPointX(0);
$this->setPointY(13);
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Pinpoint.php,v 1.5 2005/08/24 20:35:53 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker/Icon.php
*/
require_once 'Image/Graph/Marker/Icon.php';
/**
* Data marker using a pinpoint as marker.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Pinpoint extends Image_Graph_Marker_Icon
{
/**
* Create the marker as a pin point
*/
function Image_Graph_Marker_Pinpoint()
{
parent::Image_Graph_Marker_Icon(
dirname(__FILE__).'/../Images/Icons/pinpoint.png'
);
$this->setPointX(0);
$this->setPointY(13);
}
}
?>

View File

@@ -1,98 +1,98 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Plus.php,v 1.7 2005/08/03 21:21:54 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as a plus.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Plus extends Image_Graph_Marker
{
/**
* The thickness of the plus in pixels (thickness is actually double this)
* @var int
* @access private
*/
var $_thickness = 2;
/**
* 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);
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Plus.php,v 1.7 2005/08/03 21:21:54 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as a plus.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Plus extends Image_Graph_Marker
{
/**
* The thickness of the plus in pixels (thickness is actually double this)
* @var int
* @access private
*/
var $_thickness = 2;
/**
* 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);
}
}
?>

View File

@@ -1,140 +1,140 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Pointing.php,v 1.8 2005/08/24 20:35:54 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as a 'pointing marker'.
*
* Points to the data using another marker (as start and/or end)
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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 extends Image_Graph_Marker
{
/**
* The starting marker
* @var Marker
* @access private
*/
var $_markerStart;
/**
* The ending marker
* @var Marker
* @access private
*/
var $_markerEnd;
/**
* The X offset from the 'data'
* @var int
* @access private
*/
var $_deltaX = -1;
/**
* The Y offset from the 'data'
* @var int
* @access private
*/
var $_deltaY = -1;
/**
* Create an pointing marker, ie a pin on a board
*
* @param int $deltaX The the X offset from the real 'data' point
* @param int $deltaY The the Y offset from the real 'data' point
* @param Marker $markerEnd The ending marker that represents 'the head of
* the pin'
*/
function Image_Graph_Marker_Pointing($deltaX, $deltaY, & $markerEnd)
{
parent::Image_Graph_Marker();
$this->_deltaX = $deltaX;
$this->_deltaY = $deltaY;
$this->_markerStart = null;
$this->_markerEnd =& $markerEnd;
}
/**
* Sets the starting marker, ie the tip of the pin on a board
*
* @param Marker $markerStart The starting marker that represents 'the tip
* of the pin'
*/
function setMarkerStart(& $markerStart)
{
$this->_markerStart =& $markerStart;
$this->_markerStart->_setParent($this);
}
/**
* 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
);
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Pointing.php,v 1.8 2005/08/24 20:35:54 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as a 'pointing marker'.
*
* Points to the data using another marker (as start and/or end)
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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 extends Image_Graph_Marker
{
/**
* The starting marker
* @var Marker
* @access private
*/
var $_markerStart;
/**
* The ending marker
* @var Marker
* @access private
*/
var $_markerEnd;
/**
* The X offset from the 'data'
* @var int
* @access private
*/
var $_deltaX = -1;
/**
* The Y offset from the 'data'
* @var int
* @access private
*/
var $_deltaY = -1;
/**
* Create an pointing marker, ie a pin on a board
*
* @param int $deltaX The the X offset from the real 'data' point
* @param int $deltaY The the Y offset from the real 'data' point
* @param Marker $markerEnd The ending marker that represents 'the head of
* the pin'
*/
function Image_Graph_Marker_Pointing($deltaX, $deltaY, & $markerEnd)
{
parent::Image_Graph_Marker();
$this->_deltaX = $deltaX;
$this->_deltaY = $deltaY;
$this->_markerStart = null;
$this->_markerEnd =& $markerEnd;
}
/**
* Sets the starting marker, ie the tip of the pin on a board
*
* @param Marker $markerStart The starting marker that represents 'the tip
* of the pin'
*/
function setMarkerStart(& $markerStart)
{
$this->_markerStart =& $markerStart;
$this->_markerStart->_setParent($this);
}
/**
* 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
);
}
}
?>

View File

@@ -1,105 +1,105 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Angular.php,v 1.5 2005/08/24 20:36:03 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker/Pointing.php
*/
require_once 'Image/Graph/Marker/Pointing.php';
/**
* Marker that points 'away' from the graph.
*
* Use this as a marker for displaying another marker pointing to the original
* point on the graph - where the 'pointer' is calculated as line orthogonal to
* a line drawn between the points neighbours to both sides (an approximate
* tangent). This should make an the pointer appear to point 'straight' out from
* the graph. The 'head' of the pointer is then another marker of any choice.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Angular extends Image_Graph_Marker_Pointing
{
/**
* The length of the angular marker
* @var int
* @access private
*/
var $_radius;
/**
* Image_Graph_AngularPointingMarker [Constructor]
* @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_Angular($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)
{
if ((isset($values['LENGTH'])) && ($values['LENGTH'] != 0)) {
$this->_deltaX = - $values['AX'] * $this->_radius / $values['LENGTH'];
$this->_deltaY = - $values['AY'] * $this->_radius / $values['LENGTH'];
}
if ((isset($values['NPY'])) && (isset($values['APY'])) &&
(isset($values['PPY'])) && ($values['NPY'] > $values['APY']) &&
($values['PPY'] > $values['APY']))
{
$this->_deltaX = - $this->_deltaX;
$this->_deltaY = - $this->_deltaY;
}
parent::_drawMarker($x, $y, $values);
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Angular.php,v 1.5 2005/08/24 20:36:03 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker/Pointing.php
*/
require_once 'Image/Graph/Marker/Pointing.php';
/**
* Marker that points 'away' from the graph.
*
* Use this as a marker for displaying another marker pointing to the original
* point on the graph - where the 'pointer' is calculated as line orthogonal to
* a line drawn between the points neighbours to both sides (an approximate
* tangent). This should make an the pointer appear to point 'straight' out from
* the graph. The 'head' of the pointer is then another marker of any choice.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Angular extends Image_Graph_Marker_Pointing
{
/**
* The length of the angular marker
* @var int
* @access private
*/
var $_radius;
/**
* Image_Graph_AngularPointingMarker [Constructor]
* @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_Angular($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)
{
if ((isset($values['LENGTH'])) && ($values['LENGTH'] != 0)) {
$this->_deltaX = - $values['AX'] * $this->_radius / $values['LENGTH'];
$this->_deltaY = - $values['AY'] * $this->_radius / $values['LENGTH'];
}
if ((isset($values['NPY'])) && (isset($values['APY'])) &&
(isset($values['PPY'])) && ($values['NPY'] > $values['APY']) &&
($values['PPY'] > $values['APY']))
{
$this->_deltaX = - $this->_deltaX;
$this->_deltaY = - $this->_deltaY;
}
parent::_drawMarker($x, $y, $values);
}
}
?>

View File

@@ -1,91 +1,91 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Radial.php,v 1.5 2005/08/24 20:36:03 nosey Exp $
* @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 <pear.nosey@veggerby.dk>
* @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);
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Radial.php,v 1.5 2005/08/24 20:36:03 nosey Exp $
* @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 <pear.nosey@veggerby.dk>
* @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);
}
}
?>

View File

@@ -1,65 +1,65 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: ReversePinpoint.php,v 1.5 2005/08/24 20:35:53 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker/Icon.php
*/
require_once 'Image/Graph/Marker/Icon.php';
/**
* Data marker using a (reverse) pinpoint as marker.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_ReversePinpoint extends Image_Graph_Marker_Icon
{
/**
* Create the marker as a reverse pin point
*/
function Image_Graph_Marker_ReversePinpoint()
{
parent::Image_Graph_Marker_Icon(
dirname(__FILE__).'/../Images/Icons/pinpointr.png'
);
$this->setPointX(10);
$this->setPointY(13);
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: ReversePinpoint.php,v 1.5 2005/08/24 20:35:53 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker/Icon.php
*/
require_once 'Image/Graph/Marker/Icon.php';
/**
* Data marker using a (reverse) pinpoint as marker.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_ReversePinpoint extends Image_Graph_Marker_Icon
{
/**
* Create the marker as a reverse pin point
*/
function Image_Graph_Marker_ReversePinpoint()
{
parent::Image_Graph_Marker_Icon(
dirname(__FILE__).'/../Images/Icons/pinpointr.png'
);
$this->setPointX(10);
$this->setPointY(13);
}
}
?>

View File

@@ -1,88 +1,88 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Star.php,v 1.2 2005/08/03 21:21:54 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as a triangle.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Star extends Image_Graph_Marker
{
/**
* 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);
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Star.php,v 1.2 2005/08/03 21:21:54 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as a triangle.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Star extends Image_Graph_Marker
{
/**
* 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);
}
}
?>

View File

@@ -1,75 +1,75 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Triangle.php,v 1.6 2005/08/03 21:21:54 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as a triangle.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Triangle extends Image_Graph_Marker
{
/**
* 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);
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Triangle.php,v 1.6 2005/08/03 21:21:54 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* Data marker as a triangle.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Triangle extends Image_Graph_Marker
{
/**
* 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);
}
}
?>

View File

@@ -1,214 +1,214 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Value.php,v 1.9 2005/08/24 20:35:52 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* A marker showing the data value.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Value extends Image_Graph_Marker
{
/**
* Datapreproccesor to format the value
* @var DataPreprocessor
* @access private
*/
var $_dataPreprocessor = null;
/**
* Which value to use from the data set, ie the X or Y value
* @var int
* @access private
*/
var $_useValue;
/**
* Create a value marker, ie a box containing the value of the 'pointing
* data'
*
* @param int $useValue Defines which value to use from the dataset, i.e. the
* X or Y value
*/
function Image_Graph_Marker_Value($useValue = IMAGE_GRAPH_VALUE_X)
{
parent::Image_Graph_Marker();
$this->_padding = 2;
$this->_useValue = $useValue;
$this->_fillStyle = 'white';
$this->_borderStyle = 'black';
}
/**
* Sets the background fill style of the element
*
* @param Image_Graph_Fill $background The background
* @see Image_Graph_Fill
*/
function setBackground(& $background)
{
$this->setFillStyle($background);
}
/**
* Sets the background color of the element
*
* @param mixed $color The color
*/
function setBackgroundColor($color)
{
$this->setFillColor($color);
}
/**
* Sets a data preprocessor for formatting the values
*
* @param DataPreprocessor $dataPreprocessor The data preprocessor
* @return Image_Graph_DataPreprocessor The data preprocessor
*/
function &setDataPreprocessor(& $dataPreprocessor)
{
$this->_dataPreprocessor =& $dataPreprocessor;
return $dataPreprocessor;
}
/**
* Get the value to display
*
* @param array $values The values representing the data the marker 'points'
* to
* @return string The display value, this is the pre-preprocessor value, to
* support for customized with multiple values. i.e show 'x = y' or '(x, y)'
* @access private
*/
function _getDisplayValue($values)
{
switch ($this->_useValue) {
case IMAGE_GRAPH_VALUE_X:
$value = $values['X'];
break;
case IMAGE_GRAPH_PCT_X_MIN:
$value = $values['PCT_MIN_X'];
break;
case IMAGE_GRAPH_PCT_X_MAX:
$value = $values['PCT_MAX_X'];
break;
case IMAGE_GRAPH_PCT_Y_MIN:
$value = $values['PCT_MIN_Y'];
break;
case IMAGE_GRAPH_PCT_Y_MAX:
$value = $values['PCT_MAX_Y'];
break;
case IMAGE_GRAPH_PCT_Y_TOTAL:
if (isset($values['SUM_Y'])) {
$value = 100 * $values['Y'] / $values['SUM_Y'];
}
else {
$value = 0;
}
break;
case IMAGE_GRAPH_POINT_ID:
$value = $values['ID'];
break;
default:
$value = $values['Y'];
break;
}
return $value;
}
/**
* 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;
$offsetY = $height/2 + $this->_padding;
$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);
}
}
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
*
* PHP versions 4 and 5
*
* LICENSE: This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This library is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library; if not, write
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Value.php,v 1.10 2006/02/28 22:48:07 nosey Exp $
* @link http://pear.php.net/package/Image_Graph
*/
/**
* Include file Image/Graph/Marker.php
*/
require_once 'Image/Graph/Marker.php';
/**
* A marker showing the data value.
*
* @category Images
* @package Image_Graph
* @subpackage Marker
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @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_Value extends Image_Graph_Marker
{
/**
* Datapreproccesor to format the value
* @var DataPreprocessor
* @access private
*/
var $_dataPreprocessor = null;
/**
* Which value to use from the data set, ie the X or Y value
* @var int
* @access private
*/
var $_useValue;
/**
* Create a value marker, ie a box containing the value of the 'pointing
* data'
*
* @param int $useValue Defines which value to use from the dataset, i.e. the
* X or Y value
*/
function Image_Graph_Marker_Value($useValue = IMAGE_GRAPH_VALUE_X)
{
parent::Image_Graph_Marker();
$this->_padding = array('left' => 2, 'top' => 2, 'right' => 2, 'bottom' => 2);
$this->_useValue = $useValue;
$this->_fillStyle = 'white';
$this->_borderStyle = 'black';
}
/**
* Sets the background fill style of the element
*
* @param Image_Graph_Fill $background The background
* @see Image_Graph_Fill
*/
function setBackground(& $background)
{
$this->setFillStyle($background);
}
/**
* Sets the background color of the element
*
* @param mixed $color The color
*/
function setBackgroundColor($color)
{
$this->setFillColor($color);
}
/**
* Sets a data preprocessor for formatting the values
*
* @param DataPreprocessor $dataPreprocessor The data preprocessor
* @return Image_Graph_DataPreprocessor The data preprocessor
*/
function &setDataPreprocessor(& $dataPreprocessor)
{
$this->_dataPreprocessor =& $dataPreprocessor;
return $dataPreprocessor;
}
/**
* Get the value to display
*
* @param array $values The values representing the data the marker 'points'
* to
* @return string The display value, this is the pre-preprocessor value, to
* support for customized with multiple values. i.e show 'x = y' or '(x, y)'
* @access private
*/
function _getDisplayValue($values)
{
switch ($this->_useValue) {
case IMAGE_GRAPH_VALUE_X:
$value = $values['X'];
break;
case IMAGE_GRAPH_PCT_X_MIN:
$value = $values['PCT_MIN_X'];
break;
case IMAGE_GRAPH_PCT_X_MAX:
$value = $values['PCT_MAX_X'];
break;
case IMAGE_GRAPH_PCT_Y_MIN:
$value = $values['PCT_MIN_Y'];
break;
case IMAGE_GRAPH_PCT_Y_MAX:
$value = $values['PCT_MAX_Y'];
break;
case IMAGE_GRAPH_PCT_Y_TOTAL:
if (isset($values['SUM_Y'])) {
$value = 100 * $values['Y'] / $values['SUM_Y'];
}
else {
$value = 0;
}
break;
case IMAGE_GRAPH_POINT_ID:
$value = $values['ID'];
break;
default:
$value = $values['Y'];
break;
}
return $value;
}
/**
* 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);
}
}
?>