Top
You are looking at an outdated 7.2.0 version of this document. Switch to the 7.14.3 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:

Name Type Description
value number | string | null Bottom bound settings for the element.

Returns:

anychart.VisualBaseWithBounds - Returns self for method chaining.

Try it:

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:

Name Type Description
value anychart.utils.RectObj | anychart.math.Rect | anychart.utils.Bounds Bounds of element.

Returns:

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

Try it:

Setter for the element bounds settings.

Params:

Name Type Description
x number | string X-coordinate.
y number | string Y-coordinate.
width number | string Width.
height number | string Height.

Returns:

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

Try it:

height

Getter for element height settings.

Returns:

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

Params:

Name Type Description
value number | string | null Height settings for the element.

Returns:

anychart.VisualBaseWithBounds - Returns self for method chaining.

Try it:

left

Getter for element left bound settings.

Returns:

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

Params:

Name Type Description
value number | string | null Left bound settings for the element.

Returns:

anychart.VisualBaseWithBounds - Returns self for method chaining.

Try it:

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:

Name Type Description
containerWidth number The width of a container in pixels.
containerHeight number Height 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:

Name Type Description
value anychart.math.Rect | null Value to set.

Returns:

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

Try it:

Getter for element right bound settings.

Returns:

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

Params:

Name Type Description
value number | string | null Right bound settings for the element.

Returns:

anychart.VisualBaseWithBounds - Returns self for method chaining.

Try it:

top

Getter for element top bound settings.

Returns:

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

Params:

Name Type Description
value number | string | null Top bound settings for the element.

Returns:

anychart.VisualBaseWithBounds - Returns self for method chaining.

Try it:

width

Getter for element width settings.

Returns:

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

Params:

Name Type Description
value number | string | null Width settings for the element.

Returns:

anychart.VisualBaseWithBounds - Returns self for method chaining.

Try it: