Documentation

Chart extends AbstractStyle

Chart style

Tags
since
0.12.0

Table of Contents

$aliases  : array<string|int, mixed>
Aliases
$index  : int|null
Index number in Style collection for named style
$styleName  : string
Style name
$categoryAxisTitle  : string
$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
$colors  : array<string|int, mixed>
A list of colors to use in the chart
$dataLabelOptions  : array<string|int, mixed>
A list of display options for data labels
$gridX  : bool
Show Gridlines for X-Axis
$gridY  : bool
Show Gridlines for Y-Axis
$height  : int
Height (in EMU)
$is3d  : bool
Is 3D; applies to pie, bar, line, area
$isAuto  : bool
Is this an automatic style? (Used primarily in OpenDocument driver)
$legendPosition  : string
Chart legend Position.
$majorTickMarkPos  : string
The position for major tick marks Possible values are 'in', 'out', 'cross', 'none'
$showAxisLabels  : bool
Show labels for axis
$showLegend  : bool
Chart legend visibility
$title  : string
Chart title
$valueAxisTitle  : string
$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
$width  : int
Width (in EMU)
__construct()  : mixed
Create a new instance
getCategoryAxisTitle()  : string
Get the categoryAxisTitle
getCategoryLabelPosition()  : string
Get the categoryLabelPosition setting
getChildStyleValue()  : mixed
Return style value of child style object, e.g. `left` from `Indentation` child style of `Paragraph`
getColors()  : array<string|int, mixed>
Get the list of colors to use in a chart.
getDataLabelOptions()  : array<string|int, mixed>
get the list of options for data labels
getHeight()  : int
Get height
getIndex()  : int|null
Get index number
getLegendPosition()  : string
Get chart legend position
getMajorTickPosition()  : mixed
getStyleName()  : string
Get style name
getTitle()  : string
Get the chart title
getValueAxisTitle()  : string
Get the valueAxisTitle
getValueLabelPosition()  : string
Get the valueAxisLabelPosition setting
getWidth()  : int
Get width
is3d()  : bool
Is 3D
isAuto()  : bool
Get is automatic style flag
isShowLegend()  : bool
Get chart legend visibility
set3d()  : self
Set 3D
setArrayStyle()  : self
Set style using associative array
setAuto()  : self
Set is automatic style flag
setCategoryAxisTitle()  : mixed
Set the title that appears on the category side of the chart
setCategoryLabelPosition()  : 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
setColors()  : self
Set the colors to use in a chart.
setDataLabelOptions()  : mixed
Set values for data label options.
setHeight()  : self
Set height
setIndex()  : self
Set index number
setLegendPosition()  : self
Set chart legend position. choices: "r" - right of chart "b" - bottom of chart "t" - top of chart "l" - left of chart "tr" - top right of chart
setMajorTickPosition()  : mixed
Set the position for major tick marks
setShowAxisLabels()  : self
Set show Gridlines for Y-Axis
setShowGridX()  : self
Set show Gridlines for X-Axis
setShowGridY()  : self
Set show Gridlines for Y-Axis
setShowLegend()  : self
Set chart legend visibility
setStyleByArray()  : self
Set style by using associative array
setStyleName()  : self
Set style name
setStyleValue()  : self
Set style value template method
setTitle()  : self
Set the chart title
setValueAxisTitle()  : mixed
Set the title that appears on the value side of the chart
setValueLabelPosition()  : mixed
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
setWidth()  : self
Set width
showAxisLabels()  : mixed
showGridX()  : bool
Show Gridlines for X-Axis
showGridY()  : mixed
setBoolVal()  : bool
Set bool value
setEnumVal()  : mixed
Set enum value
setFloatVal()  : float|null
Set float value: Convert string that contains only numeric into float
setIntVal()  : int|null
Set integer value: Convert string that contains only numeric into integer
setNonEmptyVal()  : string
Set default for null and empty value
setNumericVal()  : int|float|null
Set numeric value
setObjectVal()  : mixed
Set object value
setPairedVal()  : self
Set $property value and set $pairProperty = false when $value = true

Properties

$aliases

Aliases

protected array<string|int, mixed> $aliases = array()

$index

Index number in Style collection for named style

protected int|null $index

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

$categoryAxisTitle

private string $categoryAxisTitle

$categoryLabelPosition

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

private string $categoryLabelPosition = 'nextTo'

$colors

A list of colors to use in the chart

private array<string|int, mixed> $colors = array()

$dataLabelOptions

A list of display options for data labels

private array<string|int, mixed> $dataLabelOptions = array( 'showVal' => true, // value 'showCatName' => true, // category name 'showLegendKey' => false, //show the cart legend 'showSerName' => false, // series name 'showPercent' => false, 'showLeaderLines' => false, 'showBubbleSize' => false, )

$gridX

Show Gridlines for X-Axis

private bool $gridX = false

$gridY

Show Gridlines for Y-Axis

private bool $gridY = false

$height

Height (in EMU)

private int $height = 1000000

$is3d

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

private bool $is3d = false

$isAuto

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

private bool $isAuto = false
Tags
since
0.11.0

$legendPosition

Chart legend Position.

private string $legendPosition = 'r'

Possible values are 'r', 't', 'b', 'l', 'tr'

$majorTickMarkPos

The position for major tick marks Possible values are 'in', 'out', 'cross', 'none'

private string $majorTickMarkPos = 'none'

$showAxisLabels

Show labels for axis

private bool $showAxisLabels = false

$showLegend

Chart legend visibility

private bool $showLegend = false

$title

Chart title

private string $title = null

$valueAxisTitle

private string $valueAxisTitle

$valueLabelPosition

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

private string $valueLabelPosition = 'nextTo'

$width

Width (in EMU)

private int $width = 1000000

Methods

__construct()

Create a new instance

public __construct([array<string|int, mixed> $style = array() ]) : mixed
Parameters
$style : array<string|int, mixed> = array()
Return values
mixed

getCategoryAxisTitle()

Get the categoryAxisTitle

public getCategoryAxisTitle() : string
Return values
string

getCategoryLabelPosition()

Get the categoryLabelPosition setting

public getCategoryLabelPosition() : string
Return values
string

getChildStyleValue()

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

public getChildStyleValue(AbstractStyle $substyleObject, string $substyleProperty) : mixed
Parameters
$substyleObject : AbstractStyle
$substyleProperty : string
Tags
since
0.12.0
Return values
mixed

getColors()

Get the list of colors to use in a chart.

public getColors() : array<string|int, mixed>
Return values
array<string|int, mixed>

getDataLabelOptions()

get the list of options for data labels

public getDataLabelOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getHeight()

Get height

public getHeight() : int
Return values
int

getIndex()

Get index number

public getIndex() : int|null
Return values
int|null

getLegendPosition()

Get chart legend position

public getLegendPosition() : string
Return values
string

getMajorTickPosition()

public getMajorTickPosition() : mixed
Return values
mixed

getStyleName()

Get style name

public getStyleName() : string
Return values
string

getTitle()

Get the chart title

public getTitle() : string
Return values
string

getValueAxisTitle()

Get the valueAxisTitle

public getValueAxisTitle() : string
Return values
string

getValueLabelPosition()

Get the valueAxisLabelPosition setting

public getValueLabelPosition() : string
Return values
string

getWidth()

Get width

public getWidth() : int
Return values
int

is3d()

Is 3D

public is3d() : bool
Return values
bool

isAuto()

Get is automatic style flag

public isAuto() : bool
Return values
bool

isShowLegend()

Get chart legend visibility

public isShowLegend() : bool
Return values
bool

set3d()

Set 3D

public set3d([bool $value = true ]) : self
Parameters
$value : bool = true
Return values
self

setArrayStyle()

Set style using associative array

public setArrayStyle([array<string|int, mixed> $style = array() ]) : self
Parameters
$style : array<string|int, mixed> = array()
Tags
deprecated
0.11.0
codeCoverageIgnore
Return values
self

setAuto()

Set is automatic style flag

public setAuto([bool $value = true ]) : self
Parameters
$value : bool = true
Return values
self

setCategoryAxisTitle()

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

public setCategoryAxisTitle(string $axisTitle) : mixed
Parameters
$axisTitle : string
Return values
mixed

setCategoryLabelPosition()

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

public setCategoryLabelPosition(mixed $labelPosition) : self
Parameters
$labelPosition : mixed
Return values
self

setColors()

Set the colors to use in a chart.

public setColors([array<string|int, mixed> $value = array() ]) : self
Parameters
$value : array<string|int, mixed> = array()

a list of colors to use in the chart

Return values
self

setDataLabelOptions()

Set values for data label options.

public setDataLabelOptions([array<string|int, mixed> $values = array() ]) : mixed

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

Parameters
$values : array<string|int, mixed> = array()

[description]

Return values
mixed

setHeight()

Set height

public setHeight([int $value = null ]) : self
Parameters
$value : int = null
Return values
self

setIndex()

Set index number

public setIndex([int|null $value = null ]) : self
Parameters
$value : int|null = null
Return values
self

setLegendPosition()

Set chart legend position. choices: "r" - right of chart "b" - bottom of chart "t" - top of chart "l" - left of chart "tr" - top right of chart

public setLegendPosition([string $legendPosition = 'r' ]) : self

default: right

Parameters
$legendPosition : string = 'r'
Return values
self

setMajorTickPosition()

Set the position for major tick marks

public setMajorTickPosition(string $position) : mixed
Parameters
$position : string
Return values
mixed

setShowAxisLabels()

Set show Gridlines for Y-Axis

public setShowAxisLabels([bool $value = true ]) : self
Parameters
$value : bool = true
Return values
self

setShowGridX()

Set show Gridlines for X-Axis

public setShowGridX([bool $value = true ]) : self
Parameters
$value : bool = true
Return values
self

setShowGridY()

Set show Gridlines for Y-Axis

public setShowGridY([bool $value = true ]) : self
Parameters
$value : bool = true
Return values
self

setShowLegend()

Set chart legend visibility

public setShowLegend([bool $value = false ]) : self
Parameters
$value : bool = false
Return values
self

setStyleByArray()

Set style by using associative array

public setStyleByArray([array<string|int, mixed> $values = array() ]) : self
Parameters
$values : array<string|int, mixed> = array()
Return values
self

setStyleName()

Set style name

public setStyleName(string $value) : self
Parameters
$value : string
Return values
self

setStyleValue()

Set style value template method

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

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
$key : string
$value : string
Return values
self

setTitle()

Set the chart title

public setTitle([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setValueAxisTitle()

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

public setValueAxisTitle(string $axisTitle) : mixed
Parameters
$axisTitle : string
Return values
mixed

setValueLabelPosition()

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

public setValueLabelPosition(mixed $labelPosition) : mixed
Parameters
$labelPosition : mixed
Return values
mixed

setWidth()

Set width

public setWidth([int $value = null ]) : self
Parameters
$value : int = null
Return values
self

showAxisLabels()

public showAxisLabels() : mixed
Return values
mixed

showGridX()

Show Gridlines for X-Axis

public showGridX() : bool
Return values
bool

showGridY()

public showGridY() : mixed
Return values
mixed

setBoolVal()

Set bool value

protected setBoolVal(bool $value, bool $default) : bool
Parameters
$value : bool
$default : bool
Return values
bool

setEnumVal()

Set enum value

protected setEnumVal([mixed $value = null ][, array<string|int, mixed> $enum = array() ][, mixed $default = null ]) : mixed
Parameters
$value : mixed = null
$enum : array<string|int, mixed> = array()
$default : mixed = null
Tags
throws
InvalidArgumentException
Return values
mixed

setFloatVal()

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

protected setFloatVal(mixed $value[, float|null $default = null ]) : float|null
Parameters
$value : mixed
$default : float|null = null
Return values
float|null

setIntVal()

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

protected setIntVal(int|null $value[, int|null $default = null ]) : int|null
Parameters
$value : int|null
$default : int|null = null
Return values
int|null

setNonEmptyVal()

Set default for null and empty value

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

(was: mixed)

$default : string

(was: mixed)

Return values
string

(was: mixed)

setNumericVal()

Set numeric value

protected setNumericVal(mixed $value[, int|float|null $default = null ]) : int|float|null
Parameters
$value : mixed
$default : int|float|null = null
Return values
int|float|null

setObjectVal()

Set object value

protected setObjectVal(mixed $value, string $styleName, mixed &$style) : mixed
Parameters
$value : mixed
$styleName : string
$style : mixed
Return values
mixed

setPairedVal()

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

protected setPairedVal(bool &$property, bool &$pairProperty, bool $value) : self
Parameters
$property : bool
$pairProperty : bool
$value : bool
Return values
self

Search results