Constants

DATASERIES_TYPE_STRING

DATASERIES_TYPE_STRING = 'String'

DATASERIES_TYPE_NUMBER

DATASERIES_TYPE_NUMBER = 'Number'

Properties

$dataTypeValues

$dataTypeValues

$dataType

$dataType : string

Series Data Type.

Type

string

$dataSource

$dataSource : string

Series Data Source.

Type

string

$formatCode

$formatCode : string

Format Code.

Type

string

$pointMarker

$pointMarker : string

Series Point Marker.

Type

string

$pointCount

$pointCount : int

Point Count (The number of datapoints in the dataseries).

Type

int

$dataValues

$dataValues : array

Data Values.

Type

array — of mixed

$fillColor

$fillColor : string|string[]

Fill color (can be array with colors if dataseries have custom colors).

Type

string|string[]

$lineWidth

$lineWidth : int

Line Width.

Type

int

Methods

__construct()

__construct(string  $dataType = self::DATASERIES_TYPE_NUMBER, string  $dataSource = null, null|mixed  $formatCode = null, int  $pointCount, mixed  $dataValues = [], null|mixed  $marker = null, null|string|string[]  $fillColor = null) : mixed

Create a new DataSeriesValues object.

Parameters

string $dataType
string $dataSource
null|mixed $formatCode
int $pointCount
mixed $dataValues
null|mixed $marker
null|string|string[] $fillColor

Returns

mixed —

getDataType()

getDataType() : string

Get Series Data Type.

Returns

string —

setDataType()

setDataType(string  $dataType) : $this

Set Series Data Type.

Parameters

string $dataType

Datatype of this data series Typical values are: DataSeriesValues::DATASERIES_TYPE_STRING Normally used for axis point values DataSeriesValues::DATASERIES_TYPE_NUMBER Normally used for chart data values

Returns

$this —

getDataSource()

getDataSource() : string

Get Series Data Source (formula).

Returns

string —

setDataSource()

setDataSource(string  $dataSource) : $this

Set Series Data Source (formula).

Parameters

string $dataSource

Returns

$this —

getPointMarker()

getPointMarker() : string

Get Point Marker.

Returns

string —

setPointMarker()

setPointMarker(string  $marker) : $this

Set Point Marker.

Parameters

string $marker

Returns

$this —

getFormatCode()

getFormatCode() : string

Get Series Format Code.

Returns

string —

setFormatCode()

setFormatCode(string  $formatCode) : $this

Set Series Format Code.

Parameters

string $formatCode

Returns

$this —

getPointCount()

getPointCount() : int

Get Series Point Count.

Returns

int —

getFillColor()

getFillColor() : string|string[]

Get fill color.

Returns

string|string[] —

HEX color or array with HEX colors

setFillColor()

setFillColor(string|string[]  $color) : \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues

Set fill color for series.

Parameters

string|string[] $color

HEX color or array with HEX colors

Returns

\PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues —

getLineWidth()

getLineWidth() : int

Get line width for series.

Returns

int —

setLineWidth()

setLineWidth(int  $width) : $this

Set line width for the series.

Parameters

int $width

Returns

$this —

isMultiLevelSeries()

isMultiLevelSeries() : null|bool

Identify if the Data Series is a multi-level or a simple series.

Returns

null|bool —

multiLevelCount()

multiLevelCount() : int

Return the level count of a multi-level Data Series.

Returns

int —

getDataValues()

getDataValues() : array

Get Series Data Values.

Returns

array —

of mixed

getDataValue()

getDataValue() : mixed

Get the first Series Data value.

Returns

mixed —

setDataValues()

setDataValues(array  $dataValues) : $this

Set Series Data Values.

Parameters

array $dataValues

Returns

$this —

refresh()

refresh(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet  $worksheet, mixed  $flatten = true) : void

Parameters

\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $worksheet
mixed $flatten

validateColor()

validateColor(string  $color) : bool

Method for validating hex color.

Parameters

string $color

value for color

Returns

bool —

true if validation was successful