class TextStyle extends JsonConfig (View source)

Text Style ConfigObject

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

Constants

TYPE

Type of JsonConfig object

Methods

__construct( array $config = array())

Builds the TextStyle 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
bold( bool $bold)

Set bold on/off for the text element.

color( string $color)

Set the color for the text element.

fontName( string $fontName)

Sets the font to the textStyle object.

fontSize( integer $fontSize)

Sets the font size to the textStyle.

italic( boolean $italic)

Set italic on/off for the text element.

Details

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

Builds the TextStyle 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 67
TextStyle bold( bool $bold)

Set bold on/off for the text element.

Parameters

bool $bold

Return Value

TextStyle

Exceptions

InvalidConfigValue

at line 81
TextStyle color( string $color)

Set the color for the text element.

valid HTML color string, for example: 'red' OR '#004411'

Parameters

string $color Valid HTML color

Return Value

TextStyle

Exceptions

InvalidConfigValue

at line 95
TextStyle fontName( string $fontName)

Sets the font to the textStyle object.

Must be a valid font name.

Parameters

string $fontName Valid font name

Return Value

TextStyle

Exceptions

InvalidConfigValue

at line 107
TextStyle fontSize( integer $fontSize)

Sets the font size to the textStyle.

Parameters

integer $fontSize Font size in pixels

Return Value

TextStyle

Exceptions

InvalidConfigValue

at line 119
TextStyle italic( boolean $italic)

Set italic on/off for the text element.

Parameters

boolean $italic

Return Value

TextStyle

Exceptions

InvalidConfigValue