Properties

$styleName

$styleName : string

Style name

Type

string

$index

$index : integer|null

Index number in Style collection for named style

This number starts from one and defined in Style::setStyleValues()

Type

integer|null

$aliases

$aliases : array

Aliases

Type

array

$isAuto

$isAuto : boolean

Is this an automatic style? (Used primarily in OpenDocument driver)

Type

boolean

$width

$width : integer

Width (in EMU)

Type

integer

$height

$height : integer

Height (in EMU)

Type

integer

$is3d

$is3d : boolean

Is 3D; applies to pie, bar, line, area

Type

boolean

$colors

$colors : array

A list of colors to use in the chart

Type

array

$dataLabelOptions

$dataLabelOptions : array

A list of display options for data labels

Type

array

$categoryLabelPosition

$categoryLabelPosition : string

A string that tells the writer where to write chart labels or to skip "nextTo" - sets labels next to the axis (bar graphs on the left) (default) "low" - labels on the left side of the graph "high" - labels on the right side of the graph

Type

string

$valueLabelPosition

$valueLabelPosition : string

A string that tells the writer where to write chart labels or to skip "nextTo" - sets labels next to the axis (bar graphs on the bottom) (default) "low" - labels are below the graph "high" - labels above the graph

Type

string

$categoryAxisTitle

$categoryAxisTitle : string

Type

string

$valueAxisTitle

$valueAxisTitle : string

Type

string

$majorTickMarkPos

$majorTickMarkPos : 

Type

$showAxisLabels

$showAxisLabels : 

Type

$gridY

$gridY : boolean

Show Gridlines for Y-Axis

Type

boolean

$gridX

$gridX : boolean

Show Gridlines for X-Axis

Type

boolean

Methods

getStyleName()

getStyleName() : string

Get style name

Returns

string

setStyleName()

setStyleName(string  $value) : self

Set style name

Parameters

string $value

Returns

self

getIndex()

getIndex() : integer|null

Get index number

Returns

integer|null

setIndex()

setIndex(integer|null  $value = null) : self

Set index number

Parameters

integer|null $value

Returns

self

isAuto()

isAuto() : boolean

Get is automatic style flag

Returns

boolean

setAuto()

setAuto(boolean  $value = true) : self

Set is automatic style flag

Parameters

boolean $value

Returns

self

getChildStyleValue()

getChildStyleValue(\PhpOffice\PhpWord\Style\AbstractStyle  $substyleObject, string  $substyleProperty) : mixed

Return style value of child style object, e.g. `left` from `Indentation` child style of `Paragraph`

Parameters

\PhpOffice\PhpWord\Style\AbstractStyle $substyleObject
string $substyleProperty

Returns

mixed

setStyleValue()

setStyleValue(string  $key, string  $value) : self

Set style value template method

Some child classes have their own specific overrides. Backward compability check for versions < 0.10.0 which use underscore prefix for their private properties. Check if the set method is exists. Throws an exception?

Parameters

string $key
string $value

Returns

self

setStyleByArray()

setStyleByArray(array  $values = array()) : self

Set style by using associative array

Parameters

array $values

Returns

self

setArrayStyle()

setArrayStyle(array  $style = array()) : self

Set style using associative array

Parameters

array $style

Returns

self

__construct()

__construct(array  $style = array()) 

Create a new instance

Parameters

array $style

getWidth()

getWidth() : integer

Get width

Returns

integer

setWidth()

setWidth(integer  $value = null) : self

Set width

Parameters

integer $value

Returns

self

getHeight()

getHeight() : integer

Get height

Returns

integer

setHeight()

setHeight(integer  $value = null) : self

Set height

Parameters

integer $value

Returns

self

is3d()

is3d() : boolean

Is 3D

Returns

boolean

set3d()

set3d(boolean  $value = true) : self

Set 3D

Parameters

boolean $value

Returns

self

getColors()

getColors() : array

Get the list of colors to use in a chart.

Returns

array

setColors()

setColors(array  $value = array()) 

Set the colors to use in a chart.

Parameters

array $value

a list of colors to use in the chart

showAxisLabels()

showAxisLabels() 

setShowAxisLabels()

setShowAxisLabels(boolean  $value = true) : self

Set show Gridlines for Y-Axis

Parameters

boolean $value

Returns

self

getDataLabelOptions()

getDataLabelOptions() : array

get the list of options for data labels

Returns

array

setDataLabelOptions()

setDataLabelOptions(array  $values = array()) 

Set values for data label options.

This will only change values for options defined in $this->dataLabelOptions, and cannot create new ones.

Parameters

array $values

[description]

showGridY()

showGridY() 

setShowGridY()

setShowGridY(boolean  $value = true) : self

Set show Gridlines for Y-Axis

Parameters

boolean $value

Returns

self

getCategoryLabelPosition()

getCategoryLabelPosition() : string

Get the categoryLabelPosition setting

Returns

string

setCategoryLabelPosition()

setCategoryLabelPosition(mixed  $labelPosition) : self

Set the categoryLabelPosition setting "none" - skips writing labels "nextTo" - sets labels next to the (bar graphs on the left) "low" - labels on the left side of the graph "high" - labels on the right side of the graph

Parameters

mixed $labelPosition

Returns

self

getValueLabelPosition()

getValueLabelPosition() : string

Get the valueAxisLabelPosition setting

Returns

string

setValueLabelPosition()

setValueLabelPosition(mixed  $labelPosition) 

Set the valueLabelPosition setting "none" - skips writing labels "nextTo" - sets labels next to the value "low" - sets labels are below the graph "high" - sets labels above the graph

Parameters

mixed $labelPosition

getCategoryAxisTitle()

getCategoryAxisTitle() : string

Get the categoryAxisTitle

Returns

string

setCategoryAxisTitle()

setCategoryAxisTitle(string  $axisTitle) 

Set the title that appears on the category side of the chart

Parameters

string $axisTitle

getValueAxisTitle()

getValueAxisTitle() : string

Get the valueAxisTitle

Returns

string

setValueAxisTitle()

setValueAxisTitle(string  $axisTitle) 

Set the title that appears on the value side of the chart

Parameters

string $axisTitle

getMajorTickPosition()

getMajorTickPosition() 

setMajorTickPosition()

setMajorTickPosition(string  $position) 

set the position for major tick marks

Parameters

string $position

[description]

showGridX()

showGridX() 

setShowGridX()

setShowGridX(boolean  $value = true) : self

Set show Gridlines for X-Axis

Parameters

boolean $value

Returns

self

setNonEmptyVal()

setNonEmptyVal(string  $value, string  $default) : string

Set default for null and empty value

Parameters

string $value

(was: mixed)

string $default

(was: mixed)

Returns

string —

(was: mixed)

setBoolVal()

setBoolVal(boolean  $value, boolean  $default) : boolean

Set bool value

Parameters

boolean $value
boolean $default

Returns

boolean

setNumericVal()

setNumericVal(mixed  $value, integer|float|null  $default = null) : integer|float|null

Set numeric value

Parameters

mixed $value
integer|float|null $default

Returns

integer|float|null

setIntVal()

setIntVal(integer|null  $value, integer|null  $default = null) : integer|null

Set integer value: Convert string that contains only numeric into integer

Parameters

integer|null $value
integer|null $default

Returns

integer|null

setFloatVal()

setFloatVal(mixed  $value, float|null  $default = null) : float|null

Set float value: Convert string that contains only numeric into float

Parameters

mixed $value
float|null $default

Returns

float|null

setEnumVal()

setEnumVal(mixed  $value = null, array  $enum = array(), mixed  $default = null) : mixed

Set enum value

Parameters

mixed $value
array $enum
mixed $default

Throws

\InvalidArgumentException

Returns

mixed

setObjectVal()

setObjectVal(mixed  $value, string  $styleName,   $style) : mixed

Set object value

Parameters

mixed $value
string $styleName
$style

Returns

mixed

setPairedVal()

setPairedVal(  $property,   $pairProperty, boolean  $value) : self

Set $property value and set $pairProperty = false when $value = true

Parameters

$property
$pairProperty
boolean $value

Returns

self