Modified the 'How to use?' message for info about mousewheel zoom and panning feature
[phpmyadmin/ammaryasirr.git] / libraries / svg_plot / pma_svg_data_point.php
blob7d01b2b5669b3ddbf573fecad43d7fa9bb1f6008
1 <?php
2 /**
3 * Handles the visualization of Data Point objects.
5 * @package phpMyAdmin
6 */
8 require_once 'pma_svg_data_element.php';
10 class PMA_SVG_Data_Point extends PMA_SVG_Data_Element
13 * X-Coordinate of the point
15 private $cx;
18 * Y-Coordinate of the point
20 private $cy;
23 * A private constructor; prevents direct creation of object.
25 public function __construct($cx, $cy, $label, $dataRow)
27 parent::__construct($label,$dataRow);
28 $this->cx = $cx;
29 $this->cy = $cy;
33 public function prepareRowAsSVG($options)
35 return $this->prepareSvg($options);
38 /**
39 * Prepares and returns the code related to a row in the query result as SVG.
41 * @param array $options Array containing options related to properties of the point
43 * @return the code related to a row in the query result.
46 protected function prepareSvg($options)
48 $point_options = array(
49 'name' => $this->label . '_' .$options['id'],
50 'id' => $this->label . 'id' . '_' . $options['id'],
51 'class' => 'point',
52 'fill' => 'white',
53 'stroke' => $options['color'],
54 'stroke-width'=> 2,
57 $row = '<circle cx="' . $this->cx . '" cy="' . $this->cy . '" r=".1"';
58 foreach ($point_options as $option => $val) {
59 $row .= ' ' . $option . '="' . trim($val) . '"';
61 $row .= '/>';
63 return $row;
66 public function getCx()
68 return $this->cx;
71 public function setCx($cx)
73 $this->cx = $cx;
76 public function getCy()
78 return $this->cy;
81 public function setCy($cy)
83 $this->cy = $cy;