class Legend extends ConfigObject (View source)

Properties

string $position Position of the legend.
string $alignment Alignment of the legend.
TextStyle $textStyle Text style of the legend.

Methods

mixed
__construct( array $config = array())

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

array
toArray( string $keyName = null)

Returns an array representation of the object.

array
getValues()

Same as toArray, but without the class name as a key to being multi-dimension.

position( string $position)

Sets the position of the legend.

alignment( string $alignment)

Sets the alignment of the legend.

textStyle( TextStyle $textStyle)

An object that specifies the legend text style.

Details

at line 54
mixed __construct( array $config = array())

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

Parameters

array $config Array of options.

Return Value

mixed

Exceptions

InvalidConfigValue
InvalidConfigProperty

in ConfigObject at line 93
array toArray( string $keyName = null)

Returns an array representation of the object.

If passed a label, then the array will be returned with the label as the key.

Called with no label returns an array with the classname as the key.

Parameters

string $keyName Key name to be applied to generated array.

Return Value

array Assoc. array of the options of the object.

in ConfigObject at line 115
array getValues()

Same as toArray, but without the class name as a key to being multi-dimension.

Return Value

array Array of the options of the object.

at line 72
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

at line 113
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

at line 140
Legend textStyle( TextStyle $textStyle)

An object that specifies the legend text style.

Parameters

TextStyle $textStyle Style of the legend

Return Value

Legend