Legend
in package
implements
ComparableInterface
\PhpOffice\PhpPresentation\Shape\Chart\Legend.
Table of Contents
Interfaces
- ComparableInterface
- PhpOffice\PhpPresentation\ComparableInterface.
Constants
- POSITION_BOTTOM = 'b'
- Legend positions
- POSITION_LEFT = 'l'
- POSITION_RIGHT = 'r'
- POSITION_TOP = 't'
- POSITION_TOPRIGHT = 'tr'
Properties
- $alignment : Alignment
- Alignment.
- $border : Border
- Border.
- $fill : Fill
- Fill.
- $font : null|Font
- Font.
- $hashIndex : int
- Hash index.
- $height : float
- Height (as a fraction of the chart).
- $offsetX : float
- OffsetX (as a fraction of the chart).
- $offsetY : float
- OffsetY (as a fraction of the chart).
- $position : string
- Position.
- $visible : bool
- Visible.
- $width : float
- Width (as a fraction of the chart).
Methods
- __construct() : mixed
- Create a new \PhpOffice\PhpPresentation\Shape\Chart\Legend instance.
- getAlignment() : Alignment
- Get alignment.
- getBorder() : Border
- Get Border.
- getFill() : Fill
- Get Fill.
- getFont() : Font|null
- Get font.
- getHashCode() : string
- Get hash code.
- getHashIndex() : null|int
- Get hash index.
- getHeight() : float
- Get Height (as a fraction of the chart).
- getOffsetX() : float
- Get OffsetX (as a fraction of the chart).
- getOffsetY() : float
- Get OffsetY (as a fraction of the chart).
- getPosition() : string
- Get Position.
- getWidth() : float
- Get Width (as a fraction of the chart).
- isVisible() : bool
- Get Visible.
- setAlignment() : Legend
- Set alignment.
- setBorder() : Legend
- Set Border.
- setFill() : Legend
- Set Fill.
- setFont() : self
- Set font.
- setHashIndex() : Legend
- Set hash index.
- setHeight() : self
- Set Height (as a fraction of the chart).
- setOffsetX() : self
- Set OffsetX (as a fraction of the chart).
- setOffsetY() : self
- Set OffsetY (as a fraction of the chart).
- setPosition() : Legend
- Set Position.
- setVisible() : Legend
- Set Visible.
- setWidth() : self
- Set Width (as a fraction of the chart).
Constants
POSITION_BOTTOM
Legend positions
public
mixed
POSITION_BOTTOM
= 'b'
POSITION_LEFT
public
mixed
POSITION_LEFT
= 'l'
POSITION_RIGHT
public
mixed
POSITION_RIGHT
= 'r'
POSITION_TOP
public
mixed
POSITION_TOP
= 't'
POSITION_TOPRIGHT
public
mixed
POSITION_TOPRIGHT
= 'tr'
Properties
$alignment
Alignment.
private
Alignment
$alignment
$border
Border.
private
Border
$border
$fill
Fill.
private
Fill
$fill
$font
Font.
private
null|Font
$font
$hashIndex
Hash index.
private
int
$hashIndex
$height
Height (as a fraction of the chart).
private
float
$height
= 0
$offsetX
OffsetX (as a fraction of the chart).
private
float
$offsetX
= 0
$offsetY
OffsetY (as a fraction of the chart).
private
float
$offsetY
= 0
$position
Position.
private
string
$position
= self::POSITION_RIGHT
$visible
Visible.
private
bool
$visible
= true
$width
Width (as a fraction of the chart).
private
float
$width
= 0
Methods
__construct()
Create a new \PhpOffice\PhpPresentation\Shape\Chart\Legend instance.
public
__construct() : mixed
getAlignment()
Get alignment.
public
getAlignment() : Alignment
Return values
AlignmentgetBorder()
Get Border.
public
getBorder() : Border
Return values
BordergetFill()
Get Fill.
public
getFill() : Fill
Return values
FillgetFont()
Get font.
public
getFont() : Font|null
Return values
Font|nullgetHashCode()
Get hash code.
public
getHashCode() : string
Return values
string —Hash code
getHashIndex()
Get hash index.
public
getHashIndex() : null|int
Note that this index may vary during script execution! Only reliable moment is while doing a write of a workbook and when changes are not allowed.
Return values
null|int —Hash index
getHeight()
Get Height (as a fraction of the chart).
public
getHeight() : float
Return values
floatgetOffsetX()
Get OffsetX (as a fraction of the chart).
public
getOffsetX() : float
Return values
floatgetOffsetY()
Get OffsetY (as a fraction of the chart).
public
getOffsetY() : float
Return values
floatgetPosition()
Get Position.
public
getPosition() : string
Return values
stringgetWidth()
Get Width (as a fraction of the chart).
public
getWidth() : float
Return values
floatisVisible()
Get Visible.
public
isVisible() : bool
Return values
boolsetAlignment()
Set alignment.
public
setAlignment(Alignment $alignment) : Legend
Parameters
- $alignment : Alignment
Return values
LegendsetBorder()
Set Border.
public
setBorder(Border $border) : Legend
Parameters
- $border : Border
Return values
LegendsetFill()
Set Fill.
public
setFill(Fill $fill) : Legend
Parameters
- $fill : Fill
Return values
LegendsetFont()
Set font.
public
setFont([null|Font $pFont = null ]) : self
Parameters
- $pFont : null|Font = null
-
Font
Return values
selfsetHashIndex()
Set hash index.
public
setHashIndex(int $value) : Legend
Note that this index may vary during script execution! Only reliable moment is while doing a write of a workbook and when changes are not allowed.
Parameters
- $value : int
-
Hash index
Return values
LegendsetHeight()
Set Height (as a fraction of the chart).
public
setHeight([float $value = 0 ]) : self
Parameters
- $value : float = 0
Return values
selfsetOffsetX()
Set OffsetX (as a fraction of the chart).
public
setOffsetX([float $pValue = 0 ]) : self
Parameters
- $pValue : float = 0
Return values
selfsetOffsetY()
Set OffsetY (as a fraction of the chart).
public
setOffsetY([float $pValue = 0 ]) : self
Parameters
- $pValue : float = 0
Return values
selfsetPosition()
Set Position.
public
setPosition([string $value = self::POSITION_RIGHT ]) : Legend
Parameters
- $value : string = self::POSITION_RIGHT
Return values
LegendsetVisible()
Set Visible.
public
setVisible([bool $value = true ]) : Legend
Parameters
- $value : bool = true
Return values
LegendsetWidth()
Set Width (as a fraction of the chart).
public
setWidth([float $pValue = 0 ]) : self
Parameters
- $pValue : float = 0