class BarFormat extends Format (View source)

BarFormat Object

Adds a colored bar to a numeric cell indicating whether the cell value is above or below a specified base value.

Constants

TYPE

Type of format object

Methods

__construct( array $config = array())

Builds the BarFormat object with specified 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
string
getType()

Returns the format type.

from  Format
base( int|float $base)

A number indicating the base value, used to compare against the cell value.

colorNegative( string $colorNegative)

A string indicating the negative value section of bars.

colorPositive( string $colorPositive)

A string indicating the color of the positive value section of bars.

drawZeroLine( boolean $drawZeroLine)

A boolean indicating if to draw a 1 pixel dark base line when negative values are present.

max( int|float $max)

The maximum number value for the bar range.

min( int|float $min)

The minimum number value for the bar range.

showValue($showValue)

If true, shows values and bars; if false, shows only bars.

width( boolean $width)

Thickness of each bar, in pixels.

Details

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

Builds the BarFormat object with specified 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 Format at line 46
string getType()

Returns the format type.

Return Value

string

at line 74
BarFormat base( int|float $base)

A number indicating the base value, used to compare against the cell value.

If the cell value is higher, the cell will include a green up arrow. If the cell value is lower, it will include a red down arrow. If the same, no arrow.

Parameters

int|float $base

Return Value

BarFormat

Exceptions

InvalidConfigValue

at line 89
BarFormat colorNegative( string $colorNegative)

A string indicating the negative value section of bars.

Possible values are 'red', 'green' and 'blue';

Parameters

string $colorNegative

Return Value

BarFormat

Exceptions

InvalidConfigValue

at line 110
BarFormat colorPositive( string $colorPositive)

A string indicating the color of the positive value section of bars.

Possible values are 'red', 'green' and 'blue'. Default is 'blue'.

Parameters

string $colorPositive

Return Value

BarFormat

Exceptions

InvalidConfigValue

at line 131
BarFormat drawZeroLine( boolean $drawZeroLine)

A boolean indicating if to draw a 1 pixel dark base line when negative values are present.

The dark line is there to enhance visual scanning of the bars.

Parameters

boolean $drawZeroLine

Return Value

BarFormat

Exceptions

InvalidConfigValue

at line 146
BarFormat max( int|float $max)

The maximum number value for the bar range.

Default value is the highest value in the table.

Parameters

int|float $max

Return Value

BarFormat

Exceptions

InvalidConfigValue

at line 161
BarFormat min( int|float $min)

The minimum number value for the bar range.

Default value is the lowest value in the table.

Parameters

int|float $min

Return Value

BarFormat

Exceptions

InvalidConfigValue

at line 174
BarFormat showValue($showValue)

If true, shows values and bars; if false, shows only bars.

Parameters

$showValue

Return Value

BarFormat

Exceptions

InvalidConfigValue

at line 187
BarFormat width( boolean $width)

Thickness of each bar, in pixels.

Parameters

boolean $width

Return Value

BarFormat

Exceptions

InvalidConfigValue