Documentation

Chart extends AbstractStyle
in package

Chart style.

Tags
since
0.12.0

Table of Contents

Properties

$aliases  : array<string|int, mixed>
Aliases.
$index  : null|int
Index number in Style collection for named style.
$styleName  : string|null
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).

Methods

__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()  : null|int
Get index number.
getLegendPosition()  : string
Get chart legend position.
getMajorTickPosition()  : mixed
getStyleName()  : string|null
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.
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()  : void
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()  : void
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()  : null|float
Set float value: Convert string that contains only numeric into float.
setIntVal()  : null|int
Set integer value: Convert string that contains only numeric into integer.
setNonEmptyVal()  : string
Set default for null and empty value.
setNumericVal()  : null|float|int
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 = []

$index

Index number in Style collection for named style.

protected null|int $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 = []

$dataLabelOptions

A list of display options for data labels.

private array<string|int, mixed> $dataLabelOptions = [ '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

$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 = [] ]) : mixed
Parameters
$style : array<string|int, 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

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() : null|int
Return values
null|int

getLegendPosition()

Get chart legend position.

public getLegendPosition() : string
Return values
string

getMajorTickPosition()

public getMajorTickPosition() : mixed

getStyleName()

Get style name.

public getStyleName() : string|null
Return values
string|null

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

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

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 = [] ]) : self
Parameters
$value : array<string|int, mixed> = []

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 = [] ]) : void

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

Parameters
$values : array<string|int, mixed> = []

[description]

setHeight()

Set height.

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

setIndex()

Set index number.

public setIndex([null|int $value = null ]) : self
Parameters
$value : null|int = 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) : void
Parameters
$position : string

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 = [] ]) : self
Parameters
$values : array<string|int, mixed> = []
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, array<string|int, mixed>|int|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 : array<string|int, mixed>|int|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

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

setWidth()

Set width.

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

showAxisLabels()

public showAxisLabels() : mixed

showGridX()

Show Gridlines for X-Axis.

public showGridX() : bool
Return values
bool

showGridY()

public showGridY() : 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 = [] ][, mixed $default = null ]) : mixed
Parameters
$value : mixed = null
$enum : array<string|int, mixed> = []
$default : mixed = null

setFloatVal()

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

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

setIntVal()

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

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

setNonEmptyVal()

Set default for null and empty value.

protected setNonEmptyVal(string|null $value, string $default) : string
Parameters
$value : string|null
$default : string
Return values
string

setNumericVal()

Set numeric value.

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

setObjectVal()

Set object value.

protected setObjectVal(mixed $value, string $styleName, mixed &$style) : mixed
Parameters
$value : mixed
$styleName : string
$style : 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

        
On this page

Search results