Source for file LegendSymbol.php
Documentation is available at LegendSymbol.php
* <p>Title: LegendSymbol class</p>
* <p>Description: Legend item symbol characteristics</p>
* <p>Copyright (c) 2005-2010 by Steema Software SL. All Rights
* <p>Company: Steema Software SL</p>
* Determines if legend symbol should display without separation from other
* Controls where to display the legend symbol related to symbol item.
* Internal field pointing to parent legend class
private $defaultPen= true;
function __get( $property ) {
$method = "get{$property}";
function __set ( $property,$value ) {
$method = "set{$property}";
return $this->$method($value);
$this->widthUnits = LegendSymbolSize::$PERCENT;
parent::__construct($legend->chart);
* Defines the width of the color rectangles (symbols).<br>
* The position of the Legend color rectangles. <br>
* It can have one of the following values: <br>
* Left The color rectangles are placed left of the legend items <br>
* Right The color rectangles are placed right of the legend items <br>
* @return LegendSymbolPosition
* Sets the position of the Legend color rectangles. <br>
* @param value LegendSymbolPosition
* Defines the Width units for the width of Symbol.<br><br>
* - Percent is percentage of Legend box width <br>
* - Pixels is the width in standard pixels <br>
* @return LegendSymbolSize
return $this->widthUnits;
* Sets the Width units for the width of Symbol.<br><br>
* @param value LegendSymbolSize
if ($this->widthUnits != $value) {
$this->widthUnits = $value;
* Adjoins the different legend color rectangles when true.<br> The color
* rectangles of the different items are drawn attached to each other
* (no vertical spacing). When false, the color rectangles are drawn as
* seperate rectangles. <br>
* Adjoins the different legend color rectangles when true.<br>
* Uses series pen properties to draw a border around the coloured box
* legend symbol, when true. When false, the Legend will use the legend
* symbol Pen property. <br>
return $this->defaultPen;
* Uses series pen properties to draw a border around the coloured box
* legend symbol, when true. When false, the Legend will use the legend
* symbol Pen property. <br>
/*todo review protected*/ public function calcWidth($value) {
return $this->legend->calcItemHeight() - 5;
return MathUtils::round($this->width * $value * 0.01);
* pen used to draw a border around the color box legend symbols. <br>
* By default this pen is not used. Instead, the appropiate Series pen is
* used to draw the symbols borders.<br>
* To use this Pen, first set DefaultPen to false.
if ($this->iPen == null) {
* Resizes the legend symbol to square shaped, when true.<br>
* When false, the legend symbol height is determined by the legend font
* size, and the symbol width is calculated using the Width and WidthUnits
* Resizes the legend symbol to square shaped, when true.<br>
* Shows or hides Legend symbols.<br>
* Shows or hides Legend symbols.<br>
|