ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PhpOffice\PhpSpreadsheet\Chart\Legend Class Reference
+ Collaboration diagram for PhpOffice\PhpSpreadsheet\Chart\Legend:

Public Member Functions

 __construct ($position=self::POSITION_RIGHT, ?Layout $layout=null, $overlay=false)
 Create a new Legend. More...
 
 getPosition ()
 Get legend position as an excel string value. More...
 
 setPosition ($position)
 Get legend position using an excel string value. More...
 
 getPositionXL ()
 Get legend position as an Excel internal numeric value. More...
 
 setPositionXL ($positionXL)
 Set legend position using an Excel internal numeric value. More...
 
 getOverlay ()
 Get allow overlay of other elements? More...
 
 setOverlay ($overlay)
 Set allow overlay of other elements? More...
 
 getLayout ()
 Get Layout. More...
 

Data Fields

const XL_LEGEND_POSITION_BOTTOM = -4107
 Legend positions. More...
 
const XL_LEGEND_POSITION_CORNER = 2
 
const XL_LEGEND_POSITION_CUSTOM = -4161
 
const XL_LEGEND_POSITION_LEFT = -4131
 
const XL_LEGEND_POSITION_RIGHT = -4152
 
const XL_LEGEND_POSITION_TOP = -4160
 
const POSITION_RIGHT = 'r'
 
const POSITION_LEFT = 'l'
 
const POSITION_BOTTOM = 'b'
 
const POSITION_TOP = 't'
 
const POSITION_TOPRIGHT = 'tr'
 

Private Attributes

 $position = self::POSITION_RIGHT
 
 $overlay = true
 
 $layout
 

Static Private Attributes

static $positionXLref
 

Detailed Description

Definition at line 5 of file Legend.php.

Constructor & Destructor Documentation

◆ __construct()

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

Create a new Legend.

Parameters
string$position
bool$overlay

Definition at line 57 of file Legend.php.

References PhpOffice\PhpSpreadsheet\Chart\Legend\$layout, PhpOffice\PhpSpreadsheet\Chart\Legend\$overlay, PhpOffice\PhpSpreadsheet\Chart\Legend\$position, PhpOffice\PhpSpreadsheet\Chart\Legend\setOverlay(), and PhpOffice\PhpSpreadsheet\Chart\Legend\setPosition().

58  {
59  $this->setPosition($position);
60  $this->layout = $layout;
61  $this->setOverlay($overlay);
62  }
setPosition($position)
Get legend position using an excel string value.
Definition: Legend.php:81
setOverlay($overlay)
Set allow overlay of other elements?
Definition: Legend.php:135
+ Here is the call graph for this function:

Member Function Documentation

◆ getLayout()

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

Get Layout.

Returns
Layout

Definition at line 145 of file Legend.php.

References PhpOffice\PhpSpreadsheet\Chart\Legend\$layout.

146  {
147  return $this->layout;
148  }

◆ getOverlay()

PhpOffice\PhpSpreadsheet\Chart\Legend::getOverlay ( )

Get allow overlay of other elements?

Returns
bool

Definition at line 125 of file Legend.php.

References PhpOffice\PhpSpreadsheet\Chart\Legend\$overlay.

126  {
127  return $this->overlay;
128  }

◆ getPosition()

PhpOffice\PhpSpreadsheet\Chart\Legend::getPosition ( )

Get legend position as an excel string value.

Returns
string

Definition at line 69 of file Legend.php.

References PhpOffice\PhpSpreadsheet\Chart\Legend\$position.

70  {
71  return $this->position;
72  }

◆ getPositionXL()

PhpOffice\PhpSpreadsheet\Chart\Legend::getPositionXL ( )

Get legend position as an Excel internal numeric value.

Returns
int

Definition at line 97 of file Legend.php.

98  {
99  return array_search($this->position, self::$positionXLref);
100  }

◆ setOverlay()

PhpOffice\PhpSpreadsheet\Chart\Legend::setOverlay (   $overlay)

Set allow overlay of other elements?

Parameters
bool$overlay

Definition at line 135 of file Legend.php.

References PhpOffice\PhpSpreadsheet\Chart\Legend\$overlay.

Referenced by PhpOffice\PhpSpreadsheet\Chart\Legend\__construct().

135  : void
136  {
137  $this->overlay = $overlay;
138  }
+ Here is the caller graph for this function:

◆ setPosition()

PhpOffice\PhpSpreadsheet\Chart\Legend::setPosition (   $position)

Get legend position using an excel string value.

Parameters
string$positionsee self::POSITION_*
Returns
bool

Definition at line 81 of file Legend.php.

References PhpOffice\PhpSpreadsheet\Chart\Legend\$position.

Referenced by PhpOffice\PhpSpreadsheet\Chart\Legend\__construct().

82  {
83  if (!in_array($position, self::$positionXLref)) {
84  return false;
85  }
86 
87  $this->position = $position;
88 
89  return true;
90  }
+ Here is the caller graph for this function:

◆ setPositionXL()

PhpOffice\PhpSpreadsheet\Chart\Legend::setPositionXL (   $positionXL)

Set legend position using an Excel internal numeric value.

Parameters
int$positionXLsee self::XL_LEGEND_POSITION_*
Returns
bool

Definition at line 109 of file Legend.php.

110  {
111  if (!isset(self::$positionXLref[$positionXL])) {
112  return false;
113  }
114 
115  $this->position = self::$positionXLref[$positionXL];
116 
117  return true;
118  }

Field Documentation

◆ $layout

PhpOffice\PhpSpreadsheet\Chart\Legend::$layout
private

◆ $overlay

PhpOffice\PhpSpreadsheet\Chart\Legend::$overlay = true
private

◆ $position

PhpOffice\PhpSpreadsheet\Chart\Legend::$position = self::POSITION_RIGHT
private

◆ $positionXLref

PhpOffice\PhpSpreadsheet\Chart\Legend::$positionXLref
staticprivate
Initial value:
= [
self::XL_LEGEND_POSITION_BOTTOM => self::POSITION_BOTTOM

Definition at line 21 of file Legend.php.

◆ POSITION_BOTTOM

const PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_BOTTOM = 'b'

Definition at line 17 of file Legend.php.

◆ POSITION_LEFT

const PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_LEFT = 'l'

Definition at line 16 of file Legend.php.

◆ POSITION_RIGHT

const PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_RIGHT = 'r'

Definition at line 15 of file Legend.php.

◆ POSITION_TOP

const PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_TOP = 't'

Definition at line 18 of file Legend.php.

◆ POSITION_TOPRIGHT

const PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_TOPRIGHT = 'tr'

Definition at line 19 of file Legend.php.

◆ XL_LEGEND_POSITION_BOTTOM

const PhpOffice\PhpSpreadsheet\Chart\Legend::XL_LEGEND_POSITION_BOTTOM = -4107

Legend positions.

Definition at line 8 of file Legend.php.

◆ XL_LEGEND_POSITION_CORNER

const PhpOffice\PhpSpreadsheet\Chart\Legend::XL_LEGEND_POSITION_CORNER = 2

Definition at line 9 of file Legend.php.

◆ XL_LEGEND_POSITION_CUSTOM

const PhpOffice\PhpSpreadsheet\Chart\Legend::XL_LEGEND_POSITION_CUSTOM = -4161

Definition at line 10 of file Legend.php.

◆ XL_LEGEND_POSITION_LEFT

const PhpOffice\PhpSpreadsheet\Chart\Legend::XL_LEGEND_POSITION_LEFT = -4131

Definition at line 11 of file Legend.php.

◆ XL_LEGEND_POSITION_RIGHT

const PhpOffice\PhpSpreadsheet\Chart\Legend::XL_LEGEND_POSITION_RIGHT = -4152

Definition at line 12 of file Legend.php.

◆ XL_LEGEND_POSITION_TOP

const PhpOffice\PhpSpreadsheet\Chart\Legend::XL_LEGEND_POSITION_TOP = -4160

Definition at line 13 of file Legend.php.


The documentation for this class was generated from the following file: