AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.core.utils.Bounds Improve this Doc

Extends: anychart.core.Base

Stores information about visual location of an object.
Can be defined with an object, a anychart.math#rect or as a set of numbers.
Note: "right" and "bottom" have priority over "width" and "height".

Methods Overview

Size and Position
bottom()Bottom position.
height()Height settings.
left()Left position.
maxHeight()Maximum height.
minHeight()Minimum height.
minWidth()Minimum width.
right()Right position.
top()Top position.
width()Width settings.
Size and Position.
maxWidth()Maximum width
Miscellaneous
set()Resets all values of the object by passed values.
toRect()Normalizes all info stored in this object.

Methods Description

bottom

Getter for the bottom edge position.

Returns:

number | string | null - Returns previously set position, not the derived pixel value.
Setter for the bottom edge position.

Params:

NameTypeDescription
bottomnumber | string | nullBottom edge position to set.

Returns:

anychart.core.utils.Bounds - Self instance for method chaining.

height

Getter for the height value.

Returns:

number | string | null - Returns previously set position, not the derived pixel value.
Setter for the height value.

Params:

NameTypeDescription
heightnumber | string | nullHeight to set.

Returns:

anychart.core.utils.Bounds - Self instance for method chaining.

left

Getter for the left edge position.

Returns:

number | string | null - Returns previously set position, not the derived pixel value.
Setter for the left edge position.

Params:

NameTypeDescription
leftnumber | string | nullLeft edge position to set.

Returns:

anychart.core.utils.Bounds - Self instance for method chaining.

maxHeight

Getter for the maximum height value.

Returns:

number | string | null - Returns previously set position, not the derived pixel value.
Setter for the maximum height value.

Params:

NameTypeDescription
heightnumber | string | nullMaximum height to set.

Returns:

anychart.core.utils.Bounds - Self instance for method chaining.

maxWidth

Getter for the maximum width value.

Returns:

number | string | null - Returns previously set position, not the derived pixel value.
Setter for the maximum width value.

Params:

NameTypeDescription
widthnumber | string | nullMaximum width to set.

Returns:

anychart.core.utils.Bounds - Self instance for method chaining.

minHeight

Getter for the minimum height value.

Returns:

number | string | null - Returns previously set position, not the derived pixel value.
Setter for the minimum height value.

Params:

NameTypeDescription
heightnumber | string | nullMinimum height to set.

Returns:

anychart.core.utils.Bounds - Self instance for method chaining.

minWidth

Getter for the minimum width value.

Returns:

number | string | null - Returns previously set position, not the derived pixel value.
Setter for the minimum width value.

Params:

NameTypeDescription
widthnumber | string | nullMinimum width to set.

Returns:

anychart.core.utils.Bounds - Self instance for method chaining.
Getter for the right edge position.

Returns:

number | string | null - Returns previously set position, not the derived pixel value.
Setter for the right edge position.

Params:

NameTypeDescription
rightnumber | string | nullRight edge position to set.

Returns:

anychart.core.utils.Bounds - Self instance for method chaining.

set

Resets all values of the object by passed values.
Note: 'right' and 'bottom' have priority over 'width' and 'height'.

Params:

NameTypeDescription
xOrRectnumber | string | Array.<(number|null)> | anychart.utils.RectObj | anychart.math.Rect | anychart.core.utils.Bounds | nullX-coordinate or the rect as object.
ynumber | string | nullY-coordinate.
widthnumber | string | nullWidth.
heightnumber | string | nullHeight.

Returns:

anychart.core.utils.Bounds - Self instance for method chaining.

toRect

Normalizes all info stored in this object.

Params:

NameTypeDescription
parentLeftOrRectnumber | anychart.math.Rect | ObjectOptional left coordinate of the parent is used, to shift bounds if parent in shifted.
parentTopnumberOptional top coordinate of the parent is used, to shift bounds if parent in shifted.
parentWidthnumberOptional parent width is used, to support percent cases.
parentHeightnumberOptional parent height is used, to support percent cases.

Returns:

anychart.math.Rect - Returns a standard rect of object.

top

Getter for the top edge position.

Returns:

number | string | null - Returns previously set position, not the derived pixel value.
Setter for the top edge position.

Params:

NameTypeDescription
topnumber | string | nullTop edge position to set.

Returns:

anychart.core.utils.Bounds - Self instance for method chaining.

width

Getter for the width value.

Returns:

number | string | null - Returns previously set position, not the derived pixel value.
Setter for the width value.

Params:

NameTypeDescription
widthnumber | string | nullWidth to set.

Returns:

anychart.core.utils.Bounds - Self instance for method chaining.