Top
You are looking at an outdated 7.3.0 version of this document. Switch to the 7.14.3 version to see the up to date information.

class anychart.core.utils.Space Improve this Doc

Extends: anychart.core.Base

Stores space info for 4 sides. Can accept numbers and strings as side spaces. For initializing values meaning see set() method.

Methods Overview

Miscellaneous
bottom()Gets or sets bottom space. Returns previously set space, not the derived pixel value.
left()Gets or sets left space. Returns previously set space, not the derived pixel value.
right()Gets or sets right space. Returns previously set space, not the derived pixel value.
set()Resets all offsets using values passed.
top()Gets or sets top space. Returns previously set space, not the derived pixel value.

Methods Description

bottom

Gets or sets bottom space. Returns previously set space, not the derived pixel value.

Params:

Name Type Description
value number | string | null Value to set.

Returns:

number string anychart.core.utils.Space - Value or itself for chaining.

left

Gets or sets left space. Returns previously set space, not the derived pixel value.

Params:

Name Type Description
value number | string | null Value to set.

Returns:

number string anychart.core.utils.Space - Value, or itself for chaining.
Gets or sets right space. Returns previously set space, not the derived pixel value.

Params:

Name Type Description
value number | string | null Value to set.

Returns:

number string anychart.core.utils.Space - Value or itself for chaining.

set

Resets all offsets using values passed. Can accept other Space object or from 0 to 4 values (numbers or percent strings). Space values are applied just as in CSS: 1) set(25, 50, 75, 100): top space is 25 right space is 50 bottom space is 75 left space is 100 2) set(25, 50, 75): top space is 25 right and left spaces are 50 bottom space is 75 3) set(25, 50): top and bottom spaces are 25 right and left spaces are 50 4) set(25): all four spaces are 25 Also can accept arrays (applied, like it is an apply) and objects with 'left', 'top', 'right' and 'bottom' fields. NOTE: set(): all four spaces are 0

Params:

Name Type Description
spaceOrTopOrTopAndBottom string | number | Array.<(number|string)> | Object Space object or top or top and bottom space.
rightOrRightAndLeft string | number Right or right and left space.
bottom string | number Bottom space.
left string | number Left space.

Returns:

anychart.core.utils.Space - Returns itself for chaining.

top

Gets or sets top space. Returns previously set space, not the derived pixel value.

Params:

Name Type Description
value number | string | null Value to set.

Returns:

number string anychart.core.utils.Space - Value or itself for method chaining.