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

$position

$position : string

Legend position.

Type

string

$overlay

$overlay : bool

Allow overlay of other elements?

Type

bool

$layout

$layout : \PhpOffice\PhpSpreadsheet\Chart\Layout

Legend Layout.

Type

Layout

Methods

__construct()

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

Create a new Legend.

Parameters

string $position
?\PhpOffice\PhpSpreadsheet\Chart\Layout $layout
bool $overlay

Returns

mixed —

getPosition()

getPosition() : string

Get legend position as an excel string value.

Returns

string —

setPosition()

setPosition(string  $position) : bool

Get legend position using an excel string value.

Parameters

string $position

see self::POSITION_*

Returns

bool —

getPositionXL()

getPositionXL() : int

Get legend position as an Excel internal numeric value.

Returns

int —

setPositionXL()

setPositionXL(int  $positionXL) : bool

Set legend position using an Excel internal numeric value.

Parameters

int $positionXL

see self::XL_LEGEND_POSITION_*

Returns

bool —

getOverlay()

getOverlay() : bool

Get allow overlay of other elements?

Returns

bool —

setOverlay()

setOverlay(bool  $overlay) : bool

Set allow overlay of other elements?

Parameters

bool $overlay

Returns

bool —

getLayout()

getLayout() : \PhpOffice\PhpSpreadsheet\Chart\Layout

Get Layout.

Returns

\PhpOffice\PhpSpreadsheet\Chart\Layout —