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

class anychart.graphics.vector.Rect Improve this Doc

Extends: anychart.graphics.vector.PathBase

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.

Methods Overview

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

Methods Description

cut

Sets cut corners.

Params:

NameTypeDescription
radiusAllstring | numberRadius 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 - anychart.graphics.vector.Rect instance for method chaining.
Sets cut corners.

Params:

NameTypeDescription
radiusLeftTopstring | numberRadius 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.
radiusRightTopnumberTop-right corner radius.
radiusRightBottomnumberBottom-right corner radius.
radiusLeftBottomnumberBottom-left corner radius.

Returns:

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

round

Sets corners rounding.

Params:

NameTypeDescription
radiusAllstring | numberRadius 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 - anychart.graphics.vector.Rect instance for method chaining.
Sets corners rounding.

Params:

NameTypeDescription
radiusLeftTopstring | numberRadius 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.
radiusRightTopnumberTop-right corner radius.
radiusRightBottomnumberBottom-right corner radius.
radiusLeftBottomnumberBottom-left corner radius.

Returns:

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

roundInner

Sets corners inner rounding.

Params:

NameTypeDescription
radiusAllstring | numberRadius 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 - anychart.graphics.vector.Rect instance for method chaining.
Sets corners inner rounding.

Params:

NameTypeDescription
radiusLeftTopstring | numberRadius 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.
radiusRightTopnumberTop-right corner radius.
radiusRightBottomnumberBottom-right corner radius.
radiusLeftBottomnumberBottom-left corner radius.

Returns:

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

setBounds

Sets bounds.

Params:

NameTypeDescription
valueanychart.graphics.math.RectBounds.

Returns:

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

setCoordinate

Sets position in parent container.

Params:

NameTypeDescription
valueanychart.graphics.math.CoordinatePosition in parent container.

Returns:

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

setHeight

Sets height.

Params:

NameTypeDescription
valuenumberHeight.

Returns:

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

setWidth

Sets width.

Params:

NameTypeDescription
valuenumberWidth.

Returns:

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

setX

Sets X in parent container.

Params:

NameTypeDescription
valuenumberX in parent container.

Returns:

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

setY

Sets Y in parent container.

Params:

NameTypeDescription
valuenumberY in parent container.

Returns:

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