AnyChart
API Reference
Still have questions?
Contact support
Top
You are looking at an outdated 7.9.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

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:

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 - Self instance for method chaining.
Sets cut corners.

Params:

NameTypeDescription
radiusLeftTopnumberTop-left corner radius.
radiusRightTopnumberTop-right corner radius.
radiusRightBottomnumberBottom-right corner radius.
radiusLeftBottomnumberBottom-left corner radius.

Returns:

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

round

Sets corners rounding using single value.

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 - Self instance for method chaining.
Sets corners rounding using several value.

Params:

NameTypeDescription
radiusLeftTopnumberTop-left corner radius.
radiusRightTopnumberTop-right corner radius.
radiusRightBottomnumberBottom-right corner radius.
radiusLeftBottomnumberBottom-left corner radius.

Returns:

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

Params:

NameTypeDescription
radiusLeftTopnumberTop-left corner radius.
radiusRightTopnumberTop-right corner radius.
radiusRightBottomnumberBottom-right corner radius.
radiusLeftBottomnumberBottom-left corner radius.

Returns:

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

setBounds

Sets bounds.

Params:

NameTypeDescription
valueanychart.graphics.math.RectBounds.

Returns:

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

setCoordinate

Sets a position in parent container.

Params:

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

Returns:

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

setHeight

Sets a height.

Params:

NameTypeDescription
valuenumberHeight.

Returns:

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

setSize

Sets a size.

Params:

NameTypeDescription
valueanychart.graphics.math.SizeSize.

Returns:

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

setWidth

Sets a width.

Params:

NameTypeDescription
valuenumberWidth.

Returns:

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

setX

Sets X in parent container.

Params:

NameTypeDescription
valuenumberX in parent container.

Returns:

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

setY

Sets Y in parent container.

Params:

NameTypeDescription
valuenumberY in parent container.

Returns:

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