Source for file Bubble.php
Documentation is available at Bubble.php
* Description: Bubble Series
* $bubbleSeries = new Bubble($myChart->getChart());
* $bubbleSeries->getXValues().setDateTime(true);
* $bubbleSeries->getRadiusValues()->setDateTime(false);
* $bubbleSeries->getRadiusValues()->setName("Radius");
* $bubbleSeries->getRadiusValues()->setOrder(ValueListOrder::$NONE);
* $bubbleSeries->setHorizontalAxis(HorizontalAxis::$TOP);
* $bubbleSeries->getMarks()->setArrowLength(0);
* $bubbleSeries->getMarks()->setClip(true);
* $bubbleSeries->getMarks()->getFont().setColor(Color::getWhite);
* $bubbleSeries->getMarks()->getFont().setSize(16);
* $bubbleSeries->getMarks()->getFont().setItalic(true);
* $bubbleSeries->getMarks()->getFrame().setVisible(false);
* $bubbleSeries->getMarks()->setTransparent(true);
* $bubbleSeries->getMarks()->setVisible(false);
* $bubbleSeries->getPointer()->setHorizSize(14);
* $bubbleSeries->getPointer()->setVertSize(14);
* $bubbleSeries->getPointer()->setInflateMargins(false);
* $bubbleSeries->setVisible(true);
* @copyright (c) 1995-2008 by Steema Software SL. All Rights Reserved. <info@steema.com>
* @link http://www.steema.com
function __get( $property ) {
$method = "get{$property}";
function __set ( $property,$value ) {
$method = "set{$property}";
return $this->$method($value);
public function Bubble($c = null)
if ($this->radiusValues== null) {
$this->point->setInflateMargins(false);
$point->allowChangeSize = false;
$this->getMarks()->getPen()->setDefaultVisible(false);
$this->getMarks()->setArrowLength(0- ($this->getChart()->getGraphics3D()->getFontHeight() / 2));
$this->getMarks()->setTransparent(true);
$this->getMarks()->getArrow()->setVisible(false);
* Determines how the Bubble size is calculated.<br>
* By default, the horizontal and vertical Bubble sizes are equal to the
* radius of each bubble. When Squared is false, Bubble horizontal and
* vertical sizes are calculated independently based on Series axis scales.
* Determines how the Bubble size is calculated.<br>
private function applyRadius($value, $aList, $increment)
for($t = 0; $t < $this->getCount() - 1; $t++ )
$result = max($result, $aList->value[$t] + $this->radiusValues->value[$t]);
$result = min($result, $aList->value[$t] - $this->radiusValues->value[$t]);
// some sample values to see something in design mode...
for($t = 1; $t <= $numValues; $t++ )
$this->__add($r->tmpX, // $this->X
($r->DifY / 15.0) + MathUtils::round($r->DifY / (10 + 15 * $r->Random())));// $this->Radius
$tmp = min($r->width, $r->height);
$this->point->setHorizSize($tmp);
$this->point->setVertSize($tmp);
parent::drawLegendShape($g, $valueIndex, $r);
* Called internally. Draws the "ValueIndex" point of the Series.
/* This overrided method is the main paint for bubble points.
The bubble effect is achieved by changing the Pointer.Size based
for $the $this->series-> */
$tmpSize = $this->calcYSizeValue($this->radiusValues->value[$valueIndex]);
$this->point->setHorizSize($this->squared ? $tmpSize :
$this->point->setVertSize($tmpSize);
/* dont call inherited to avoid drawing the "pointer" */
* Adds a new Bubble point to the Series Points List and color.<br>
* The Bubble point is assigned to be at AX, AY coordinates and have
* ARadius and Color parameters. The Label parameter is used to
* draw Axis Labels, Bubble Marks and Legend.
* @param x double x coordinate of bubble point.
* @param y double y coordinate of bubble point.
public function ___add($x, $y, $radius, $color = null)
return $this->addBubble($x, $y, $radius, "", $color);
* Adds a new Bubble point to the Series Points List.<br>
* The Bubble point is assigned to be at AX, AY coordinates and has
* ARadius parameter. The Label parameter is used to
* draw Axis Labels, Bubble Marks and Legend.
* @param x double x coordinate of bubble point.
* @param y double y coordinate of bubble point.
public function __add($x, $y, $radius)
$tmpColor = new Color(0, 0, 0, 0, true);// EMPTY color
return $this->addBubble($x, $y, $radius, "", $tmpColor);
* Adds a new Bubble point to the Series Points List and label.<br>
* The Bubble point is assigned to be at AX, AY coordinates and have
* ARadius and Label parameters. The Label parameter is used to
* draw Axis Labels, Bubble Marks and Legend.
* @param x double x coordinate of bubble point.
* @param y double y coordinate of bubble point.
public function _add($x, $y, $radius, $text)
$tmpColor = new Color(0, 0, 0, 0, true);// EMPTY color
return $this->addBubble($x, $y, $radius, $text, $tmpColor);
* Adds a new Bubble point to the Series Points List, label and color.<br>
* The Bubble point is assigned to be at AX, AY coordinates and have
* ARadius, Label and Color parameters. The Label parameter is used to
* draw Axis Labels, Bubble Marks and Legend.
* @param x double x coordinate of bubble point.
* @param y double y coordinate of bubble point.
public function addBubble($x, $y, $radius, $text= "", $color= null)
$this->radiusValues->tempValue = $radius;
* It's used to validate the DataSource property both at design and
* It returns false if the Value parameter is the same as Self.
return $value instanceof Bubble;// $to $this->Bubbles->
* The Maximum Value of the Series Y Values List.
return $this->applyRadius(parent::getMaxYValue(), $this->vyValues, true);
* The Minimum Value of the Series Y Values List.
return $this->applyRadius(parent::getMinYValue(), $this->vyValues, false);
if($this->point->getDraw3D())
return $this->radiusValues->getMaximum();
return parent::getMaxZValue();
if($this->point->getDraw3D())
return parent::getMinZValue();
* A TList object that stores each Bubble point Radius value.<br>
* You can change Radius values by using the RadiusValues.Value[] array
if ($this->radiusValues== null)
return $this->radiusValues;
* A TList object that stores each Bubble point Radius value.<br>
* Controls which color will be drawn on the bubbles.<br>
* If false, all points will be drawn using Series Series.Color.
* If true, each Series point will be "colored" with its corresponding
* You can change this property both at design and runtime.<br>
|