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

class anychart.graphics.vector.Rect Improve this Doc

Rectangle class
Do not invoke constructor directly. Use anychart.graphics.vector.Stage#rect or anychart.graphics.vector.Layer#rect to create stage or layer bound rectangle.
If you need unbound rectangle - use anychart.graphics#rect.
See also:
anychart.graphics.vector.Stage#rect
anychart.graphics.vector.Layer#rect
anychart.graphics#rect

Methods Overview

Size and Position
setCoordinate()Sets a position in parent container.
setWidth()Sets a width.
setX()Sets X in parent container.
setY()Sets Y in parent container.
Miscellaneous
cut()Sets cut corners.
round()Sets corners rounding using single value.
roundInner()Sets corners inner rounding.
setBounds()Sets bounds.
setHeight()Sets a height.
setSize()Sets a size.

Methods Description

cut

Sets cut corners.

Params:

Name Type Description
radiusAll string | number Radius for all corners if only one value is provided, top-left corner if other values are set. Four values should be in topLeft, topRight, bottomRight, bottomLeft order.

Returns:

anychart.graphics.vector.Rect - Self instance for method chaining.
Sets cut corners.

Params:

Name Type Description
radiusLeftTop number Top-left corner radius.
radiusRightTop number Top-right corner radius.
radiusRightBottom number Bottom-right corner radius.
radiusLeftBottom number Bottom-left corner radius.

Returns:

anychart.graphics.vector.Rect - Self instance for method chaining.

Try it:

round

Sets corners rounding using single value.

Params:

Name Type Description
radiusAll string | number Radius for all corners if only one value is provided, top-left corner if other values are set. Four values should be in topLeft, topRight, bottomRight, bottomLeft order.

Returns:

anychart.graphics.vector.Rect - Self instance for method chaining.
Sets corners rounding using several value.

Params:

Name Type Description
radiusLeftTop number Top-left corner radius.
radiusRightTop number Top-right corner radius.
radiusRightBottom number Bottom-right corner radius.
radiusLeftBottom number Bottom-left corner radius.

Returns:

anychart.graphics.vector.Rect - Self instance for method chaining.

Try it:

roundInner

Sets corners inner rounding.

Params:

Name Type Description
radiusAll string | number Radius for all corners if only one value is provided, top-left corner if other values are set. Four values should be in topLeft, topRight, bottomRight, bottomLeft order.

Returns:

anychart.graphics.vector.Rect - Self instance for method chaining.
Sets corners inner rounding.

Params:

Name Type Description
radiusLeftTop number Top-left corner radius.
radiusRightTop number Top-right corner radius.
radiusRightBottom number Bottom-right corner radius.
radiusLeftBottom number Bottom-left corner radius.

Returns:

anychart.graphics.vector.Rect - Self instance for method chaining.

Try it:

setBounds

Sets bounds.

Params:

Name Type Description
value anychart.graphics.math.Rect Bounds.

Returns:

anychart.graphics.vector.Rect - Self instance for method chaining.

Try it:

setCoordinate

Sets a position in parent container.

Params:

Name Type Description
value anychart.graphics.math.Coordinate Position in parent container.

Returns:

anychart.graphics.vector.Rect - Self instance for method chaining.

Try it:

setHeight

Sets a height.

Params:

Name Type Description
value number Height.

Returns:

anychart.graphics.vector.Rect - Self instance for method chaining.

Try it:

setSize

Sets a size.

Params:

Name Type Description
value anychart.graphics.math.Size Size.

Returns:

anychart.graphics.vector.Rect - Self instance for method chaining.

Try it:

setWidth

Sets a width.

Params:

Name Type Description
value number Width.

Returns:

anychart.graphics.vector.Rect - Self instance for method chaining.

Try it:

setX

Sets X in parent container.

Params:

Name Type Description
value number X in parent container.

Returns:

anychart.graphics.vector.Rect - Self instance for method chaining.

Try it:

setY

Sets Y in parent container.

Params:

Name Type Description
value number Y in parent container.

Returns:

anychart.graphics.vector.Rect - Self instance for method chaining.

Try it: