AnyChart
API Reference
Still have questions?
Contact support
Top
You are looking at an outdated 7.1.1 version of this document. Switch to the 8.4.0 version to see the up to date information.

class anychart.VisualBaseWithBounds Improve this Doc

Extends: anychart.VisualBase

An extended base element that understands bounds settings and can handle percent values in it.

Methods Overview

Miscellaneous
bottom()Getter for element bottom bound settings.
bounds()Getter for the element bounds settings.
height()Getter for element height settings.
left()Getter for element left bound settings.
pixelBounds()Returns the current bounds.
right()Getter for element right bound settings.
top()Getter for element top bound settings.
width()Getter for element width settings.

Methods Description

bottom

Getter for element bottom bound settings.

Returns:

number | string | undefined - Current element's bottom bound settings.
Sets element bottom.

Params:

NameTypeDescription
valuenumber | string | nullBottom bound settings for the element.

Returns:

anychart.VisualBaseWithBounds - Returns self for method chaining.

bounds

Getter for the element bounds settings.

Returns:

anychart.utils.Bounds - Current bounds of the element.
Sets bounds of the element using one parameter.

Params:

NameTypeDescription
valueanychart.utils.RectObj | anychart.math.Rect | anychart.utils.BoundsBounds of element.

Returns:

anychart.VisualBaseWithBounds - An instance of anychart.VisualBase class for method chaining.
Setter for the element bounds settings.

Params:

NameTypeDescription
xnumber | stringX-coordinate.
ynumber | stringY-coordinate.
widthnumber | stringWidth.
heightnumber | stringHeight.

Returns:

anychart.VisualBaseWithBounds - An instance of anychart.VisualBase class for method chaining.

height

Getter for element height settings.

Returns:

number | string | undefined - Current element's height settings.
Sets element height.

Params:

NameTypeDescription
valuenumber | string | nullHeight settings for the element.

Returns:

anychart.VisualBaseWithBounds - Returns self for method chaining.

left

Getter for element left bound settings.

Returns:

number | string | undefined - Current element's left bound settings.
Sets element left.

Params:

NameTypeDescription
valuenumber | string | nullLeft bound settings for the element.

Returns:

anychart.VisualBaseWithBounds - Returns self for method chaining.

pixelBounds

Returns the current bounds.
Note: If the width and/or height were set in percents using anychart.VisualBaseWithBounds#bounds method, we may have problems with autocalculation (size has never been never passed in pixels for any of the nesting containers). In such case we need to pass pixel size of the container using containerWidth and containerHeight. In any other case you don't need to set them!
Note: If this method was used as a setter then no matter what parameters set you get those passed to setter.

Params:

NameTypeDescription
containerWidthnumberThe width of a container in pixels.
containerHeightnumberHeight of a container in pixels.

Returns:

anychart.math.Rect - Returns the rect with determined pixel bounds.
Sets exact pixel bounds of the element.
Note: If you pass null then previous value is reset and bounds are autocalculated.

Params:

NameTypeDescription
valueanychart.math.Rect | nullValue to set.

Returns:

anychart.VisualBaseWithBounds - An instance of anychart.VisualBase class for method chaining.
Getter for element right bound settings.

Returns:

number | string | undefined - Current element's right bound settings.
Sets element right.

Params:

NameTypeDescription
valuenumber | string | nullRight bound settings for the element.

Returns:

anychart.VisualBaseWithBounds - Returns self for method chaining.

top

Getter for element top bound settings.

Returns:

number | string | undefined - Current element's top bound settings.
Sets element top.

Params:

NameTypeDescription
valuenumber | string | nullTop bound settings for the element.

Returns:

anychart.VisualBaseWithBounds - Returns self for method chaining.

width

Getter for element width settings.

Returns:

number | string | undefined - Current element's width settings.
Sets element width.

Params:

NameTypeDescription
valuenumber | string | nullWidth settings for the element.

Returns:

anychart.VisualBaseWithBounds - Returns self for method chaining.