class HorizontalAxis extends Axis (View source)

Horizontal Axis ConfigObject

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

Constants

TYPE

Type of JsonConfig object

Methods

__construct( array $config = array())

Stores all the information about the horizontal axis. 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.

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
baseline( int|Carbon $baseline)

Sets the baseline for the axis.

from  Axis
baselineColor( string $color)

Sets the color of the baseline for the axis.

from  Axis
direction( int $direction)

Sets the direction of the axis values.

from  Axis
format( string $format)

Sets the formatting applied to the axis label. This is a subset of the ICU pattern set. For instance, '#,###%' will display values "1,000%", "750%", and "50%" for values 10, 7.5, and 0.5.

from  Axis
gridlines( array $gridlinesConfig)

Sets the color and count of the gridlines.

from  Axis
logScale( bool $logScale)

Sets the axis property that makes the axis a logarithmic scale (requires all values to be positive). Set to [ true | false ].

from  Axis
minorGridlines( array $minorGridlinesConfig)

Sets the color and count of the minorGridlines

from  Axis
maxAlternation( int $alternation)

Maximum number of levels of axis text.

from  Axis
maxTextLines( int $maxTextLines)

Maximum number of lines allowed for the text labels.

from  Axis
minTextSpacing( int $minTextSpacing)

Minimum spacing, in pixels, allowed between two adjacent text labels.

from  Axis
maxValue( int $max)

Axis property that specifies the highest axis grid line. The actual grid line will be the greater of two values: the maxValue option value, or the highest data value, rounded up to the next higher grid mark.

from  Axis
minValue( int $min)

axis property that specifies the lowest axis grid line. The actual grid line will be the lower of two values: the minValue option value, or the lowest data value, rounded down to the next lower grid mark.

from  Axis
showTextEvery( int $showTextEvery)

How many axis labels to show

from  Axis
textPosition( string $position)

Position of the axis text, relative to the chart area.

from  Axis
textStyle( array $textStyleConfig)

Sets the TextStyle options for the axis

from  Axis
title( string $title)

Axis property that specifies the title of the axis.

from  Axis
titleTextStyle( array $titleTextStyleConfig)

An object that specifies the axis title text style.

from  Axis
viewWindow( array $viewWindow)

Specifies the cropping range of the axis.

from  Axis
viewWindowMode( string $viewMode)

Specifies how to scale the axis to render the values within the chart area. The following string values are supported:

from  Axis
allowContainerBoundaryTextCutoff( boolean $cutoff)

Sets whether the container can cutoff the labels or not.

slantedText( boolean $slant)

Sets whether the labels are slanted or not.

slantedTextAngle( int $angle)

Sets the angle of the axis text, if it's drawn slanted.

Details

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

Stores all the information about the horizontal axis. 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 Axis at line 82
Axis baseline( int|Carbon $baseline)

Sets the baseline for the axis.

If the column that the baseline is defining is "number", then the baseline needs to be an integer. If the column that the baseline is defining is "date|datetime|timeofday", then the baseline needs to be a Carbon object or a string, parseable by Carbon. This option is only supported for a continuous axis.

Parameters

int|Carbon $baseline

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 110
Axis baselineColor( string $color)

Sets the color of the baseline for the axis.

Can be any HTML color string, for example: 'red' or '#00cc00'.

This option is only supported for a continuous axis.

Parameters

string $color Valid HTML color.

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 124
Axis direction( int $direction)

Sets the direction of the axis values.

specify 1 for normal, -1 to reverse the order of the values.

Parameters

int $direction

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 152
Axis format( string $format)

Sets the formatting applied to the axis label. This is a subset of the ICU pattern set. For instance, '#,###%' will display values "1,000%", "750%", and "50%" for values 10, 7.5, and 0.5.

For date axis labels, this is a subset of the date formatting ICU pattern set. For instance, "MMM d, y" will display the value "Jul 1, 2011" for the date of July first in 2011.

This option is only supported for a continuous axis.

Parameters

string $format format string for numeric or date axis labels.

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 172
Axis gridlines( array $gridlinesConfig)

Sets the color and count of the gridlines.

'color' - The color of the gridlines, Specify a valid HTML color string. 'count' - The number of horizontal gridlines inside the chart area. Minimum value is 2. Specify -1 to automatically compute the number of gridlines. array('color' => '#333', 'count' => 4);

This option is only supported for a continuous axis.

Parameters

array $gridlinesConfig

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 187
Axis logScale( bool $logScale)

Sets the axis property that makes the axis a logarithmic scale (requires all values to be positive). Set to [ true | false ].

This option is only supported for a continuous axis.

Parameters

bool $logScale

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 205
Axis minorGridlines( array $minorGridlinesConfig)

Sets the color and count of the minorGridlines

'color' - The color of the minor gridlines inside the chart area, specify a valid HTML color string. 'count' - The number of minor gridlines between two regular gridlines.

This option is only supported for a continuous axis.

Parameters

array $minorGridlinesConfig

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 225
Axis maxAlternation( int $alternation)

Maximum number of levels of axis text.

If axis text labels become too crowded, the server might shift neighboring labels up or down in order to fit labels closer together. This value specifies the most number of levels to use; the server can use fewer levels, if labels can fit without overlapping.

This option is only supported for a discrete axis.

Parameters

int $alternation

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 243
Axis maxTextLines( int $maxTextLines)

Maximum number of lines allowed for the text labels.

Labels can span multiple lines if they are too long, and the number of lines is, by default, limited by the height of the available space.

This option is only supported for a discrete axis.

Parameters

int $maxTextLines

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 262
Axis minTextSpacing( int $minTextSpacing)

Minimum spacing, in pixels, allowed between two adjacent text labels.

If the labels are spaced too densely, or they are too long, the spacing can drop below this threshold, and in this case one of the label-unclutter measures will be applied (e.g, truncating the labels or dropping some of them).

This option is only supported for a discrete axis.

Parameters

int $minTextSpacing

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 278
Axis maxValue( int $max)

Axis property that specifies the highest axis grid line. The actual grid line will be the greater of two values: the maxValue option value, or the highest data value, rounded up to the next higher grid mark.

This option is only supported for a continuous axis.

Parameters

int $max

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 294
Axis minValue( int $min)

axis property that specifies the lowest axis grid line. The actual grid line will be the lower of two values: the minValue option value, or the lowest data value, rounded down to the next lower grid mark.

This option is only supported for a continuous axis.

Parameters

int $min

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 312
Axis showTextEvery( int $showTextEvery)

How many axis labels to show

1 means show every label, 2 means show every other label, and so on. Default is to try to show as many labels as possible without overlapping.

This option is only supported for a discrete axis.

Parameters

int $showTextEvery

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 327
Axis textPosition( string $position)

Position of the axis text, relative to the chart area.

Supported values: 'out', 'in', 'none'.

Parameters

string $position Setting the position of the text.

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 345
Axis textStyle( array $textStyleConfig)

Sets the TextStyle options for the axis

Parameters

array $textStyleConfig

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 357
Axis title( string $title)

Axis property that specifies the title of the axis.

Parameters

string $title

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 369
Axis titleTextStyle( array $titleTextStyleConfig)

An object that specifies the axis title text style.

Parameters

array $titleTextStyleConfig

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 398
Axis viewWindow( array $viewWindow)

Specifies the cropping range of the axis.

For a continuous axis: The minimum and maximum data value to render. Has an effect only if $this->viewWindowMode = 'explicit'.

For a discrete axis: 'min' - The zero-based row index where the cropping window begins. Data points at indices lower than this will be cropped out. In conjunction with VerticalAxis->viewWindow['max'], it defines a half-opened range (min, max) that denotes the element indices to display. In other words, every index such that min <= index < max will be displayed.

'max' - The zero-based row index where the cropping window ends. Data points at this index and higher will be cropped out. In conjunction with VerticalAxis->viewWindow['min'], it defines a half-opened range (min, max) that denotes the element indices to display. In other words, every index such that min <= index < max will be displayed.

Parameters

array $viewWindow

Return Value

Axis

Exceptions

InvalidConfigValue

in Axis at line 437
Axis viewWindowMode( string $viewMode)

Specifies how to scale the axis to render the values within the chart area. The following string values are supported:

'pretty' - Scale the values so that the maximum and minimum data values are rendered a bit inside the left and right of the chart area. 'maximized' - Scale the values so that the maximum and minimum data values touch the left and right of the chart area. 'explicit' - Specify the left and right scale values of the chart area. Data values outside these values will be cropped. You must specify an axis.viewWindow array describing the maximum and minimum values to show.

This option is only supported for a continuous axis.

Parameters

string $viewMode

Return Value

Axis

Exceptions

InvalidConfigValue

at line 75
HorizontalAxis allowContainerBoundaryTextCutoff( boolean $cutoff)

Sets whether the container can cutoff the labels or not.

If false, will hide outermost labels rather than allow them to be cropped by the chart container. If true, will allow label cropping.

This option is only supported for a discrete axis.

Parameters

boolean $cutoff Status of allowing label cutoff

Return Value

HorizontalAxis

Exceptions

InvalidConfigValue

at line 94
HorizontalAxis slantedText( boolean $slant)

Sets whether the labels are slanted or not.

If true, draw the axis text at an angle, to help fit more text along the axis; if false, draw axis text upright. Default behavior is to slant text if it cannot all fit when drawn upright. Notice that this option is available only when the $this->textPosition is set to 'out' (which is the default). This option is only supported for a discrete axis.

Parameters

boolean $slant Status of label slant

Return Value

HorizontalAxis

Exceptions

InvalidConfigValue
InvalidOption

at line 116
HorizontalAxis slantedTextAngle( int $angle)

Sets the angle of the axis text, if it's drawn slanted.

Ignored if "slantedText" is false, or is in auto mode, and the chart decided to draw the text horizontally. This option is only supported for a discrete axis.

Parameters

int $angle Angle of labels

Return Value

HorizontalAxis

Exceptions

InvalidConfigValue