class Series extends JsonConfig (View source)

Series ConfigObject

An object containing all the values for a single series in a multiple data set chart, which can be passed into the series property of the chart's options.

Traits

Constants

TYPE

Type of JsonConfig object

Methods

__construct( array $config = array())

Builds the series object when passed an array of configuration options.

mixed
__get( string $option)

Get the value of a set option via magic method.

from  JsonConfig
getOptions()

Gets the Options object for the JsonConfig

from  JsonConfig
setOption( string $option, mixed $value)

Shortcut method to set the value of an option and return $this.

from  JsonConfig
setOptions( array $config)

Parses the config array by passing the values through each method to check validity against if the option exists.

from  JsonConfig
array
jsonSerialize()

Custom serialization of the JsonConfig object.

from  JsonConfig
areaOpacity( float $areaOpacity)

The default opacity of the colored area under a chart series

color( string $color)

Sets the color for the object carrying this trait.

from  ColorTrait
curveType( string $curveType)

Controls the curve of the lines when the line width is not zero.

labelInLegend( bool $label)

Whether the trendline should have a legend entry or not.

lineWidth( integer $width)

Data line width in pixels.

pointShape( string $shape)

The shape of individual data elements.

pointSize( integer $size)

Diameter of displayed points in pixels.

visibleInLegend( bool $visible)

Whether the trendline should have a legend entry or not.

annotation( array $annotationConfig)

An object to be applied to annotations for this series.

fallingColor( array $fallingColorConfig)

Overrides for the global Candlestick falling color options.

lineDashStyle( array $lineDashStyle)

Many styles of dashed lines are possible via the lineDashStyle option, which takes an array of numbers.

risingColor( array $risingColorConfig)

Overrides for the global Candlestick color options.

targetAxisIndex( int $index)

Which axis to assign this series to.

type( string $type)

The default line type for any series not specified in the series property.

textStyle( array $textStyleConfig)

An object that specifies the series text style.

Details

at line 72
__construct( array $config = array())

Builds the series object when passed an array of configuration options.

Parameters

array $config

Exceptions

InvalidConfigValue
InvalidConfigProperty

in JsonConfig at line 64
mixed __get( string $option)

Get the value of a set option via magic method.

Parameters

string $option Name of option.

Return Value

mixed

Exceptions

InvalidConfigProperty

in JsonConfig at line 75
Options getOptions()

Gets the Options object for the JsonConfig

Return Value

Options

in JsonConfig at line 90
JsonConfig setOption( string $option, mixed $value)

Shortcut method to set the value of an option and return $this.

In order to maintain backwards compatibility, ConfigObjects will be unwrapped.

Parameters

string $option Option to set.
mixed $value Value of the option.

Return Value

JsonConfig

in JsonConfig at line 106
setOptions( array $config)

Parses the config array by passing the values through each method to check validity against if the option exists.

Parameters

array $config

Exceptions

InvalidConfigValue
InvalidConfigProperty

in JsonConfig at line 275
array jsonSerialize()

Custom serialization of the JsonConfig object.

Return Value

array

in AreaOpacityTrait at line 20
Chart areaOpacity( float $areaOpacity)

The default opacity of the colored area under a chart series

0.0 is fully transparent and 1.0 is fully opaque. To specify opacity for an individual series, set the areaOpacity value in the series property.

Parameters

float $areaOpacity

Return Value

Chart

Exceptions

InvalidConfigValue

in ColorTrait at line 14
Chart color( string $color)

Sets the color for the object carrying this trait.

Parameters

string $color

Return Value

Chart

Exceptions

InvalidConfigValue

in CurveTypeTrait at line 18
Chart curveType( string $curveType)

Controls the curve of the lines when the line width is not zero.

Can be one of the following: 'none' - Straight lines without curve. 'function' - The angles of the line will be smoothed.

Parameters

string $curveType Accepted values [none|function]

Return Value

Chart

Exceptions

InvalidConfigValue

in LabelInLegendTrait at line 14
Chart labelInLegend( bool $label)

Whether the trendline should have a legend entry or not.

Parameters

bool $label

Return Value

Chart

Exceptions

InvalidConfigValue

in LineWidthTrait at line 17
Chart lineWidth( integer $width)

Data line width in pixels.

Use zero to hide all lines and show only the points. You can override values for individual series using the series property.

Parameters

integer $width

Return Value

Chart

Exceptions

InvalidConfigValue

in PointShapeTrait at line 19
Chart pointShape( string $shape)

The shape of individual data elements.

'circle', 'triangle', 'square', 'diamond', 'star', or 'polygon'.

Parameters

string $shape Accepted values [circle|triangle|square|diamond|star|polygon]

Return Value

Chart

Exceptions

InvalidConfigValue

See also

https://developers.google.com/chart/interactive/docs/points

in PointSizeTrait at line 17
Chart pointSize( integer $size)

Diameter of displayed points in pixels.

Use zero to hide all points. You can override values for individual series using the series property.

Parameters

integer $size

Return Value

Chart

Exceptions

InvalidConfigValue

in VisibleInLegendTrait at line 14
Chart visibleInLegend( bool $visible)

Whether the trendline should have a legend entry or not.

Parameters

bool $visible

Return Value

Chart

Exceptions

InvalidConfigValue

at line 88
Series annotation( array $annotationConfig)

An object to be applied to annotations for this series.

This can be used to control, for instance, the textStyle for the series.

Parameters

array $annotationConfig Style of the series annotations

Return Value

Series

Exceptions

InvalidConfigValue

at line 100
Series fallingColor( array $fallingColorConfig)

Overrides for the global Candlestick falling color options.

Parameters

array $fallingColorConfig

Return Value

Series

Exceptions

InvalidConfigValue

at line 120
Series lineDashStyle( array $lineDashStyle)

Many styles of dashed lines are possible via the lineDashStyle option, which takes an array of numbers.

The first number indicates the length of a dash, and the second indicates the gap after it. If there is a third number, that's the length of the next dash, and a fourth number, if present, is the length of the next gap.

When the chart is drawn, these lengths are repeated, so [4, 4] means a succession of 4-length dashes and 4-length gaps. [5, 1, 3] means a 5-length dash, a 1-length gap, a 3-length dash, a 5-length gap, and so on.

Parameters

array $lineDashStyle

Return Value

Series

Exceptions

InvalidConfigValue

at line 140
Series risingColor( array $risingColorConfig)

Overrides for the global Candlestick color options.

Parameters

array $risingColorConfig

Return Value

Series

Exceptions

InvalidConfigValue

at line 160
Series targetAxisIndex( int $index)

Which axis to assign this series to.

0 is the default axis, and 1 is the opposite axis.

Default value is 0; set to 1 to define a chart where different series are rendered against different axes.

At least one series much be allocated to the default axis. You can define a different scale for different axes.

Parameters

int $index

Return Value

Series

Exceptions

InvalidConfigValue

at line 175
Series type( string $type)

The default line type for any series not specified in the series property.

Available values are: 'line', 'area', 'bars', 'candlesticks' and 'steppedArea'

Parameters

string $type

Return Value

Series

Exceptions

InvalidConfigValue

at line 196
Series textStyle( array $textStyleConfig)

An object that specifies the series text style.

Parameters

array $textStyleConfig

Return Value

Series

Exceptions

InvalidConfigValue