class Legend extends JsonConfig (View source)

Legend ConfigObject

An object containing all the values for the legend which can be passed into the chart's options.

Constants

TYPE

Type of JsonConfig object

Methods

__construct( array $config = array())

Builds the legend 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
position( string $position)

Sets the position of the legend.

alignment( string $alignment)

Sets the alignment of the legend.

textStyle( array $textStyleConfig)

An array that specifies the legend text style options.

Details

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

Builds the legend 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

at line 71
Legend position( string $position)

Sets the position of the legend.

Can be one of the following: 'right' - To the right of the chart. Incompatible with the vAxes option. 'top' - Above the chart. 'bottom' - Below the chart. 'in' - Inside the chart, by the top left corner. 'none' - No legend is displayed.

Parameters

string $position Location of legend.

Return Value

Legend

Exceptions

InvalidConfigValue

at line 103
Legend alignment( string $alignment)

Sets the alignment of the legend.

Can be one of the following: 'start' - Aligned to the start of the area allocated for the legend. 'center' - Centered in the area allocated for the legend. 'end' - Aligned to the end of the area allocated for the legend.

Start, center, and end are relative to the style -- vertical or horizontal -- of the legend. For example, in a 'right' legend, 'start' and 'end' are at the top and bottom, respectively; for a 'top' legend, 'start' and 'end' would be at the left and right of the area, respectively.

The default value depends on the legend's position. For 'bottom' legends, the default is 'center'; other legends default to 'start'.

Parameters

string $alignment Alignment of the legend.

Return Value

Legend

Exceptions

InvalidConfigValue

at line 121
Legend textStyle( array $textStyleConfig)

An array that specifies the legend text style options.

Parameters

array $textStyleConfig

Return Value

Legend

Exceptions

InvalidConfigValue