Constants

XL_LEGEND_POSITION_BOTTOM

XL_LEGEND_POSITION_BOTTOM = -4107

Legend positions

XL_LEGEND_POSITION_CORNER

XL_LEGEND_POSITION_CORNER = 2

XL_LEGEND_POSITION_CUSTOM

XL_LEGEND_POSITION_CUSTOM = -4161

XL_LEGEND_POSITION_LEFT

XL_LEGEND_POSITION_LEFT = -4131

XL_LEGEND_POSITION_RIGHT

XL_LEGEND_POSITION_RIGHT = -4152

XL_LEGEND_POSITION_TOP

XL_LEGEND_POSITION_TOP = -4160

POSITION_RIGHT

POSITION_RIGHT = 'r'

POSITION_LEFT

POSITION_LEFT = 'l'

POSITION_BOTTOM

POSITION_BOTTOM = 'b'

POSITION_TOP

POSITION_TOP = 't'

POSITION_TOPRIGHT

POSITION_TOPRIGHT = 'tr'

Properties

$positionXLref

$positionXLref : 

Type

$position

$position : string

Legend position.

Type

string

$overlay

$overlay : boolean

Allow overlay of other elements?

Type

boolean

Methods

__construct()

__construct(string  $position = self::POSITION_RIGHT, null|\PhpOffice\PhpSpreadsheet\Chart\Layout  $layout = null, boolean  $overlay = false) 

Create a new Legend.

Parameters

string $position
null|\PhpOffice\PhpSpreadsheet\Chart\Layout $layout
boolean $overlay

getPosition()

getPosition() : string

Get legend position as an excel string value.

Returns

string

setPosition()

setPosition(string  $position) : boolean

Get legend position using an excel string value.

Parameters

string $position

see self::POSITION_*

Returns

boolean

getPositionXL()

getPositionXL() : integer

Get legend position as an Excel internal numeric value.

Returns

integer

setPositionXL()

setPositionXL(integer  $positionXL) : boolean

Set legend position using an Excel internal numeric value.

Parameters

integer $positionXL

see self::XL_LEGENDPOSITION*

Returns

boolean

getOverlay()

getOverlay() : boolean

Get allow overlay of other elements?

Returns

boolean

setOverlay()

setOverlay(boolean  $overlay) : boolean

Set allow overlay of other elements?

Parameters

boolean $overlay

Returns

boolean