class Trendline extends JsonConfig (View source)

Trendline ConfigObject

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

Traits

Constants

TYPE

Type of JsonConfig object

Methods

__construct( array $config = array())

Builds the trendline 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
color( string $color)

Sets the color for the object carrying this trait.

from  ColorTrait
labelInLegend( bool $label)

Whether the trendline should have a legend entry or not.

lineWidth( integer $width)

Data line width in pixels.

opacity( float $opacity)

Sets the transparency of assigned object points

pointSize( integer $size)

Diameter of displayed points in pixels.

visibleInLegend( bool $visible)

Whether the trendline should have a legend entry or not.

degree( bool $degree)

Sets the display of trendline points.

pointsVisible( bool $visible)

Sets the display of trendline points.

showR2( bool $visible)

Sets the display of the status of the label in the legend.

type( string $type)

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

Details

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

Builds the trendline 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 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 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 OpacityTrait at line 19
Chart opacity( float $opacity)

Sets the transparency of assigned object points

1.0 being completely opaque and 0.0 fully transparent.

Parameters

float $opacity

Return Value

Chart

Exceptions

InvalidConfigValue

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 84
Trendline degree( bool $degree)

Sets the display of trendline points.

Parameters

bool $degree

Return Value

Trendline

Exceptions

InvalidConfigValue

at line 96
Trendline pointsVisible( bool $visible)

Sets the display of trendline points.

Parameters

bool $visible

Return Value

Trendline

Exceptions

InvalidConfigValue

at line 108
Trendline showR2( bool $visible)

Sets the display of the status of the label in the legend.

Parameters

bool $visible

Return Value

Trendline

Exceptions

InvalidConfigValue

at line 122
Series type( string $type)

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

Available values are: 'line', 'exponential', 'polynomial'

Parameters

string $type

Return Value

Series

Exceptions

InvalidConfigValue