class Crosshair extends JsonConfig (View source)

Crosshair ConfigObject

An object containing the crosshair properties for the chart.

Traits

Constants

TYPE

Type of JsonConfig object

Methods

__construct( array $config = array())

Stores all the information about the crosshair.

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
opacity( float $opacity)

The crosshair opacity, with 0.0 being fully transparent and 1.0 fully opaque.

focused( array $colorConfig)

An object that specifies the crosshair focused color.

orientation( string $orientation)

The crosshair orientation, which can be 'vertical' for vertical hairs only, 'horizontal' for horizontal hairs only, or 'both' for traditional crosshairs.

selected( array $colorConfig)

An object that specifies the crosshair selected color.

trigger( string $trigger)

When to display crosshairs: on 'focus', 'selection', or 'both'.

Details

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

Stores all the information about the crosshair.

All options can be set either by passing an array with associative values for option => value, or by chaining together the functions once an object has been created.

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

at line 92
Crosshair opacity( float $opacity)

The crosshair opacity, with 0.0 being fully transparent and 1.0 fully opaque.

Parameters

float $opacity

Return Value

Crosshair

Exceptions

InvalidConfigValue

at line 80
Crosshair focused( array $colorConfig)

An object that specifies the crosshair focused color.

Parameters

array $colorConfig

Return Value

Crosshair

Exceptions

InvalidConfigValue

at line 113
Crosshair orientation( string $orientation)

The crosshair orientation, which can be 'vertical' for vertical hairs only, 'horizontal' for horizontal hairs only, or 'both' for traditional crosshairs.

Parameters

string $orientation

Return Value

Crosshair

Exceptions

InvalidConfigValue

at line 131
Crosshair selected( array $colorConfig)

An object that specifies the crosshair selected color.

Parameters

array $colorConfig

Return Value

Crosshair

Exceptions

InvalidConfigValue

at line 143
Crosshair trigger( string $trigger)

When to display crosshairs: on 'focus', 'selection', or 'both'.

Parameters

string $trigger

Return Value

Crosshair

Exceptions

InvalidConfigValue