AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.graphics.vector.Clip Improve this Doc

Class representing independent clip, that can be applied to any element.
Used to set one clip to many elements, and updates only clip.

Methods Overview

Miscellaneous
dispose()Disposes a clip. Removes it and its children from defs, clears the clip for managed elements.
shape()Shape settings for the clip.

Methods Description

dispose

Disposes a clip. Removes it and its children from defs, clears the clip for managed elements.

shape

Getter for the shape of the clip.

Returns:

anychart.graphics.vector.Shape - Returns shape instance.
See listing
var rectangle = stage.rect(20, 20, 100, 100);
rectangle.clip(stage.createClip());
var clipArea = rectangle.clip();
var shape = clipArea.shape();
Setter for the shape of the clip.

Params:

NameTypeDescription
shapeArray.<number> | anychart.graphics.vector.Shape | anychart.graphics.math.Rect | Object | nullRect or vector shape or array or object representing bounds.

Returns:

anychart.graphics.vector.Clip - Self instance for method chaining.
Setter for the shape of the clip with coordinates.

Params:

NameTypeDescription
leftnumberLeft coordinate.
topnumberTop coordinate.
widthnumberWidth of the rect.
heightnumberHeight of the rect.

Returns:

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