class anychart.graphics.vector.Stage Improve this Doc
This class provide tools for cross-browser display with the single interface for both (SVG and VML).
Do not invoke constructor directly. Use anychart.graphics#create.
Note:
anychart.graphics.vector.Stage delegates all work with DOM elements, style and attributes
to its renderer. You can get renderer using getRenderer
method.
Note: Renderer is a singleton must not contain own fields.
Rendering:
anychart.graphics.vector.Stage has the rootLayer_
private field of Layer
type. All layers and elements you add to a stage go there, so rendering and other stuff happens
when this layer is rendered.
Methods Overview
Drawing | |
asyncMode() | Stage rendering mode. |
circle() | Invokes anychart.graphics.vector.Circle constructor. |
clip() | Gets clip bounds. |
container() | Container settings. |
createClip() | Creates a clip element using single value. |
dispose() | Disposes stage. |
ellipse() | Invokes anychart.graphics.vector.Ellipse constructor. |
hatchFill() | Invokes anychart.graphics.vector.HatchFill constructor. |
html() | Invokes anychart.graphics.vector.Text and applies anychart.graphics.vector.Text#htmlText method |
image() | Invokes anychart.graphics.vector.Image constructor. |
isRendering() | Indicates if stage is in rendering process. |
isSuspended() | Returns rendering state (true - suspended, false - instant). |
layer() | Invokes anychart.graphics.vector.Layer constructor. |
path() | Invokes anychart.graphics.vector.Path constructor. |
pattern() | Invokes anychart.graphics.vector.PatternFill. |
resume() | Removes suspend state and applies all changes in sync (if any). |
suspend() | Suspends rendering (changes instant to suspended). |
text() | Invokes anychart.graphics.vector.Text constructor. |
Events | |
listen() | Adds an event listener to a stage. |
listenOnce() | Adds an event listener that is removed automatically after the listener fired once. |
removeAllListeners() | Removes all listeners from an object. You can also optionally remove listeners of some particular type. |
unlisten() | Removes a listener added with anychart.graphics.vector.Stage#listen or anychart.graphics.vector.Stage#listenOnce methods. |
unlistenByKey() | Removes an event listener which was added with anychart.graphics.vector.Stage#listen by the key returned by |
Export | |
data() | Returns stage JSON. Serializes stage and all its object to JSON. |
getJpgBase64String() | Returns JPG as base64 string. |
getPdfBase64String() | Returns PDF as base64 string. |
getPngBase64String() | Returns PNG as base64 string. |
getSvgBase64String() | Returns SVG as base64 string. |
print() | Print stage. |
saveAsJpg() | Saves the stage as JPG Image. |
saveAsPdf() | Saves the stage as PDF Document. |
saveAsPng() | Saves the stage as PNG Image. |
saveAsSvg() | Saves the stage as SVG Image. |
shareAsJpg() | Share a stage as a JPG and return link to shared image. |
shareAsPdf() | Share a stage as a PDF and return link to shared image. |
shareAsPng() | Shares a stage as a PNG file and returns a link to the shared image. |
shareAsSvg() | Share a stage as a SVG and return link to shared image. |
toSvg() | Returns SVG string |
Predefined Visual Elements | |
cross() | Draws a cross defined by a circumscribed circle. |
diagonalCross() | Draws a diagonal cross set by it circumscribed circle center and radius. |
diamond() | Draws a diamond set by it circumscribed circle center and radius. |
donut() | Draws arc as donut chart element. |
hLine() | Draws a thick horizontal line set by its circumscribed circle center and radius. |
pie() | Draws arc as pie chart element. |
rect() | Invokes anychart.graphics.vector.Rect constructor. |
roundedInnerRect() | Draws rectangle with inner rounded corners. |
roundedRect() | Draws rectangle with rounded corners. |
star() | Draws multi-pointed star. |
star10() | Draws ten-pointed star. |
star4() | Draws four-pointed star. |
star5() | Draws five-pointed star. |
star6() | Draws six-pointed star. |
star7() | Draws seven-pointed star. |
triangleDown() | Draws a triangle heading downwards set by it circumscribed circle center and radius. |
triangleLeft() | Draws a triangle heading leftwards set by it circumscribed circle center and radius. |
triangleRight() | Draws a triangle heading rightwards set by it circumscribed circle center and radius. |
triangleUp() | Draws a triangle heading upwards set by its circumscribed circle center and radius. |
truncatedRect() | Draws rectangle with truncated corners. |
vLine() | Draws a thick vertical line set by its circumscribed circle center and radius. |
Size and Position | |
getBounds() | Returns bounds. |
getX() | Returns X of top left corner. |
getY() | Returns Y of top left corner. |
height() | Stage height. |
resize() | Stage resize. Anything drawn on stage must fit in it. |
rotate() | Rotates root layer. |
rotateByAnchor() | Rotates root layer around an anchor. |
setPosition() | Sets top left corner coordinates of root layer (with transformation,in parent coordinate system). |
setRotation() | Rotates root layer around a point. |
setRotationByAnchor() | Rotates root layer around an anchor. |
width() | Stage width. |
Structure | |
addChild() | Adds an element. |
addChildAt() | Adds an element by index. |
domElement() | Returns stage root DOM element. |
forEachChild() | Applies function to all children. |
getChildAt() | Returns an element by index. |
getContainerElement() | Returns stage container element. |
getDomWrapper() | Returns a DIV wrapper that contains stage and other utilitarian DOM elements. |
getStage() | Returns self. |
hasChild() | Checks if there is such element in children set. |
id() | Stage identifier. |
indexOfChild() | Returns index of a child. |
numChildren() | A number of stage children. |
parent() | Returns self. |
remove() | Removes everything. |
removeChild() | Removes an element. |
removeChildAt() | Removes an element by index. |
removeChildren() | Removes all elements. |
swapChildren() | Swaps two children. |
swapChildrenAt() | Swaps two children by id. |
Transformations | |
appendTransformationMatrix() | Combines current transformation with another. |
getRotationAngle() | Returns rotation angle in degrees. |
getTransformationMatrix() | Returns transformation matrix. |
scale() | Scales root layer in parent coordinates system. Scaling center is set in the parent system too. |
scaleByAnchor() | Scales root layer in parent coordinates system. Scaling center is set by root layer anchor. |
setTransformationMatrix() | Sets transformation matrix. |
translate() | Moves root layer taking transformation into account. |
Miscellaneous | |
credits() | Credits settings |
desc() | Description attribute for SVG structure. |
fullScreen() | Fullscreen mode. |
isFullScreenAvailable() | Whether the context menu available in the browser or not. |
maxResizeDelay() | Getter for max delay. |
title() | Title attribute for SVG structure. |
visible() | Switch flag of stage visibility. |
Methods Description
addChild
Similar to anychart.graphics.vector.Layer#addChild
Params:
Name | Type | Description |
---|---|---|
element | anychart.graphics.vector.Element | Element. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.addChildAt
Similar to anychart.graphics.vector.Layer#addChildAt
Params:
Name | Type | Description |
---|---|---|
element | anychart.graphics.vector.Element | Element. |
index | number | Child index. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.appendTransformationMatrix
Combination is done by multiplying matrix to the right.
Read more at: anychart.graphics.vector.Element#appendTransformationMatrix.
Params:
Name | Type | Description |
---|---|---|
m00 | number | Scale X. |
m10 | number | Shear Y. |
m01 | number | Shear X. |
m11 | number | Scale Y. |
m02 | number | Translate X. |
m12 | number | Translate Y. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.asyncMode
Returns:
boolean - Returns mode.var stage = anychart.graphics.create("container"); var asyncMode = stage.asyncMode();
Params:
Name | Type | Default | Description |
---|---|---|---|
async | boolean | false | Value to set. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chainingTry it:
circle
Note:
anychart.graphics.vector.Stage doesn't delete objects you create. You must delete them yourself after you finish using them.
Read more at: anychart.graphics.vector.Circle
Params:
Name | Type | Description |
---|---|---|
cx | number | Center X, in pixels. |
cy | number | Center Y, in pixels. |
radius | number | Radius, in pixels. |
Returns:
anychart.graphics.vector.Circle - An instance of the class for method chaining.Try it:
clip
Works only after render() is invoked.
Read more at: anychart.graphics.vector.Element#clip.
Returns:
anychart.graphics.math.Rect - Clipping rectangle.Works only after render() is invoked.
Read more at: anychart.graphics.vector.Element#clip.
Params:
Name | Type | Description |
---|---|---|
rect | anychart.graphics.math.Rect | Clipping rectangle. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.container
Returns:
Element - Returns DOM element of graphics container.Try it:
Params:
Name | Type | Description |
---|---|---|
element | Element | Container DOM element. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.Try it:
createClip
Params:
Name | Type | Description |
---|---|---|
rect | Array.<number> | anychart.graphics.math.Rect | Object | null | Rect or array or object representing bounds. |
Returns:
anychart.graphics.vector.Clip - Clip element.Try it:
Params:
Name | Type | Description |
---|---|---|
left | number | Left coordinate of bounds. |
top | number | Top coordinate. |
width | number | Width of the rect. |
height | number | Height of the rect. |
Returns:
anychart.graphics.vector.Clip - Clip element.Try it:
credits
Sets stage credits settings depending on parameter type:
- null/boolean - disable or enable chart credits.
- object - sets chart credits settings.
Params:
Name | Type | Description |
---|---|---|
settings | Object | boolean | null | Credits settings. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.cross
Read more at anychart.graphics.vector.primitives#cross
Try it:
data
Returns:
Object - JSON data of stage.Try it:
Note: All settings except events and handlers are serialized. JSON object must be conformed with JSON schema (can be found in the project root). No checks are done when we deserialize - JSON schema does this. JSON schema is created in 4-th version of standard JSON schema.
Params:
Name | Type | Description |
---|---|---|
settings | Object | JSON data to set for stage. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.desc
Returns:
string | null | undefined - The element description value.Try it:
Params:
Name | Type | Description |
---|---|---|
text | string | null | Value to set. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.Try it:
diagonalCross
Read more at anychart.graphics.vector.primitives#diagonalCross
Try it:
diamond
Read more at anychart.graphics.vector.primitives#diamond
Try it:
dispose
Removes it from parent layer, nulls links, removes from DOM.
Try it:
domElement
donut
Read more at anychart.graphics.vector.primitives#donut
Try it:
ellipse
Note:
anychart.graphics.vector.Stage doesn't delete objects you create. You must delete them yourself after you finish using them.
Read more at: anychart.graphics.vector.Ellipse
Params:
Name | Type | Description |
---|---|---|
cx | number | Center X, in pixels. |
cy | number | Center Y, in pixels. |
rx | number | X radius, in pixels. |
ry | number | Y radius, in pixels. |
Returns:
anychart.graphics.vector.Ellipse - An instance of the class for method chaining.Try it:
forEachChild
Similar to anychart.graphics.vector.Layer#forEachChild
Params:
Name | Type | Description |
---|---|---|
callback | function(element:anychart.graphics.vector.Element):void | Callback. |
this | Object | This element. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.fullScreen
Returns:
boolean - Full screen state (enabled/disabled).var fullScreen = stage.fullScreen();
Params:
Name | Type | Default | Description |
---|---|---|---|
enabled | boolean | false | Enable/Disable fullscreen mode. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.Try it:
getBounds
getChildAt
Similar to anychart.graphics.vector.Layer#getChildAt
Params:
Name | Type | Description |
---|---|---|
index | number | Child index. |
Returns:
anychart.graphics.vector.Element - Element or null.getContainerElement
getDomWrapper
Returns:
Element - The inner wrapper.Try it:
getJpgBase64String
Params:
Name | Type | Description |
---|---|---|
onSuccess | function(response:string) | Function that is called when sharing is complete. |
onError | function(response:string) | Function that is called if sharing fails. |
width | number | Image width. |
height | number | Image height. |
quality | number | Image quality in ratio 0-1. |
forceTransparentWhite | boolean | Force transparent to white or not. |
Try it:
getPdfBase64String
getPdfBase64String(onSuccess, onError, paperSizeOrWidth, landscapeOrWidth, x, y)Since version 7.11.0
Params:
Name | Type | Description |
---|---|---|
onSuccess | function(response:string) | Function that is called when sharing is complete. |
onError | function(response:string) | Function that is called if sharing fails. |
paperSizeOrWidth | number | string | Any paper format like 'a0', 'tabloid', 'b4', etc. |
landscapeOrWidth | number | boolean | Define, is landscape. |
x | number | Offset X. |
y | number | Offset Y. |
Try it:
getPngBase64String
Params:
Name | Type | Description |
---|---|---|
onSuccess | function(response:string) | Function that is called when sharing is complete. |
onError | function(response:string) | Function that is called if sharing fails. |
width | number | Image width. |
height | number | Image height. |
quality | number | Image quality in ratio 0-1. |
Try it:
getRotationAngle
Read more at: anychart.graphics.vector.Element#getRotationAngle.
Returns:
number - Rotation angle.getStage
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.getSvgBase64String
Params:
Name | Type | Description |
---|---|---|
onSuccess | function(response:string) | Function that is called when sharing is complete. |
onError | function(response:string) | Function that is called if sharing fails. |
paperSizeOrWidth | string | number | Paper Size or width. |
landscapeOrHeight | boolean | string | Landscape or height. |
Try it:
getTransformationMatrix
Read more at: anychart.graphics.vector.Element#getTransformationMatrix.
Returns:
Array.<number> - Transformation matrix.getX
getY
hLine
Read more at anychart.graphics.vector.primitives#hLine
Try it:
hasChild
Similar to anychart.graphics.vector.Layer#hasChild
Params:
Name | Type | Description |
---|---|---|
element | anychart.graphics.vector.Element | Element to check. |
Returns:
boolean - Is there such element in stage or not.hatchFill
anychart.graphics.vector.Stage doesn't delete objects you create. You have to delete them yourself after you finish using them.
Read more at: anychart.graphics.vector.HatchFill
Params:
Name | Type | Description |
---|---|---|
type | anychart.graphics.vector.HatchFill.HatchFillType | Type of hatch fill. |
color | string | Hatch color (You can combine with opacity). |
thickness | number | Hatch fill thickness. |
size | number | Hatch fill size. |
Returns:
anychart.graphics.vector.HatchFill - An instance of the class for method chaining.Try it:
height
Params:
Name | Type | Description |
---|---|---|
height | string | number | Height of stage. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.Try it:
html
Note:
anychart.graphics.vector.Stage doesn't delete objects you create. You must delete them yourself after you finish using them.
Params:
Name | Type | Description |
---|---|---|
x | number | X-coordinate (Left) of left top corner of text bounds. |
y | number | Y-coordinate (Top) of left top corner of text bounds. |
text | string | Text. |
style | anychart.graphics.vector.TextStyle | Text style. Read more at anychart.graphics.vector.Text#style. |
Returns:
anychart.graphics.vector.Text - An instance of the class for method chaining.Try it:
id
Returns:
string - Returns element identifier.Try it:
Params:
Name | Type | Description |
---|---|---|
id | string | Custom identifier. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.Try it:
image
Note:
anychart.graphics.vector.Stage doesn't delete objects you create. You must delete them yourself after you finish using them.
Params:
Name | Type | Description |
---|---|---|
src | string | IRI (Internationalized Resource Identifiers) for image source. |
x | number | X coordinate of left-top corner image. |
y | number | Y coordinate of left-top corner image. |
width | number | Width of image bounds. |
height | number | Height of image bounds. |
Returns:
anychart.graphics.vector.Image - Image object instance.Try it:
indexOfChild
Similar to anychart.graphics.vector.Layer#indexOfChild
Params:
Name | Type | Description |
---|---|---|
element | anychart.graphics.vector.Element | Element. |
Returns:
number - Index or -1.isFullScreenAvailable
Returns:
boolean - isFullScreenAvailable state.Try it:
isRendering
Returns:
boolean - State of rendering process.Try it:
isSuspended
Returns:
boolean - Rendering state.Try it:
layer
Note:
anychart.graphics.vector.Stage doesn't delete objects you create. You must delete them yourself after you finish using them.
Returns:
anychart.graphics.vector.Layer - An instance of the class for method chaining.Try it:
listen
Note that if the existing listener is a one-off listener (added using listenOnce), it will no longer be a one-off listener after a call to listen() method.
Params:
Name | Type | Default | Description |
---|---|---|---|
type | string | anychart.graphics.vector.Stage.EventType | The event type name. | |
listener | function(e:Object):boolean|undefined | A function to execute each time the event is triggered. | |
useCapture | boolean | false | Whether to fire in capture phase. Learn more about capturing |
listenerScope | Object | 'Window' | Object in whose scope to call the listener. |
Returns:
Object - Unique key for the listener.Try it:
listenOnce
If the event handler being added already exists, listenOnce will do nothing.
Note In particular, if the handler is already registered using listen(), listenOnce() will not make it one-off. Similarly, if a one-off listener already exists, listenOnce will not change it (it wil remain one-off).
Params:
Name | Type | Default | Description |
---|---|---|---|
type | string | anychart.graphics.vector.Stage.EventType | The event type name. | |
listener | function(e:Object):boolean|undefined | A function to execute each time the event is triggered. | |
useCapture | boolean | false | Whether to fire in capture phase. Learn more about capturing |
listenerScope | Object | 'Window' | Object in whose scope to call the listener. |
Returns:
Object - Unique key for the listener.Try it:
maxResizeDelay
Returns:
number - Max delay value.var delay = stage.maxResizeDelay();
Params:
Name | Type | Description |
---|---|---|
delay | number | Max delay value |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.Try it:
numChildren
Similar to anychart.graphics.vector.Layer#numChildren
Returns:
number - Number of stage children.parent
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.path
Note:
anychart.graphics.vector.Stage doesn't delete objects you create. You must delete them yourself after you finish using them.
Read more at Path: anychart.graphics.vector.Path
Returns:
anychart.graphics.vector.Path - An instance of the class for method chaining.Try it:
pattern
Note:
anychart.graphics.vector.Stage doesn't delete objects you create. You must delete them yourself after you finish using them.
Read more at: anychart.graphics.vector.PatternFill
Params:
Name | Type | Description |
---|---|---|
bounds | anychart.graphics.math.Rect | Bounds of pattern. Defines size and offset of pattern. |
Returns:
anychart.graphics.vector.PatternFill - An instance of the class for method chaining.Try it:
pie
Read more at anychart.graphics.vector.primitives#pie
Try it:
Params:
Name | Type | Description |
---|---|---|
paperSizeOrWidth | string | number | Paper Size or width. |
landscapeOrHeight | boolean | string | Landscape or height. |
Try it:
rect
Note:
anychart.graphics.vector.Stage doesn't delete objects you create. You must delete them yourself after you finish using them.
Params:
Name | Type | Description |
---|---|---|
x | number | X (Left) coordinate of top-left corner. |
y | number | Y (Top) coordinate of top-left corner. |
width | number | Width. |
height | number | Height. |
Returns:
anychart.graphics.vector.Rect - An instance of the class for method chaining.Try it:
remove
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.Try it:
removeAllListeners
Params:
Name | Type | Description |
---|---|---|
type | string | Type of event to remove, default is to remove all types. |
Returns:
number - Number of listeners removed.Try it:
removeChild
Similar to anychart.graphics.vector.Layer#removeChild
Params:
Name | Type | Description |
---|---|---|
element | anychart.graphics.vector.Element | Element. |
Returns:
anychart.graphics.vector.Element - Removed element.removeChildAt
Similar to anychart.graphics.vector.Layer#removeChildAt
Params:
Name | Type | Description |
---|---|---|
index | number | Index. |
Returns:
anychart.graphics.vector.Element - Removed element.removeChildren
Similar to anychart.graphics.vector.Layer#removeChildren
Returns:
Array.<anychart.graphics.vector.Element> - Array of removed elements.resize
Params:
Name | Type | Description |
---|---|---|
width | number | string | Width. |
height | number | string | Height. |
Try it:
resume
Read more at anychart.graphics.vector.Stage#suspend.
Params:
Name | Type | Default | Description |
---|---|---|---|
force | boolean | false | If set to true - this parameter resets the stack of suspends and calls rendering immediately. |
Returns:
anychart.graphics.vector.Stage - Stage.rotate
Read more at: anychart.graphics.vector.Element#rotate.
Params:
Name | Type | Description |
---|---|---|
degrees | number | Rotation angle. |
cx | number | Rotaion X. |
cy | number | Rotaion Y. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.rotateByAnchor
Read more at: anychart.graphics.vector.Element#rotateByAnchor.
Params:
Name | Type | Description |
---|---|---|
degrees | number | Rotation angle. |
anchor | anychart.graphics.vector.Anchor | string | Rotation anchor. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.roundedInnerRect
Read more at anychart.graphics.vector.primitives#roundedInnerRect
Try it:
roundedRect
Read more at anychart.graphics.vector.primitives#roundedRect
Try it:
saveAsJpg
For export to image JPG use anychart.graphics#server.
Params:
Name | Type | Description |
---|---|---|
width | number | Image width. |
height | number | Image height. |
quality | number | Image quality in ratio 0-1. |
forceTransparentWhite | boolean | Force transparent to white or not. |
filename | string | File name to save. |
Try it:
saveAsPdf
For export to PDF file use anychart.graphics#server.
Params:
Name | Type | Description |
---|---|---|
paperSize | string | Any paper format like 'a0', 'tabloid', 'b4', etc. |
landscape | boolean | Define, is landscape. |
x | number | Offset X. |
y | number | Offset Y. |
filename | string | File name to save. |
Try it:
saveAsPng
For export to image PNG use anychart.graphics#server.
Params:
Name | Type | Description |
---|---|---|
width | number | Image width. |
height | number | Image height. |
quality | number | Image quality in ratio 0-1. |
filename | string | File name to save. |
Try it:
saveAsSvg
For export to SVG use anychart.graphics#server.
Params:
Name | Type | Description |
---|---|---|
paperSize | string | Paper Size. |
landscape | boolean | Landscape. |
filename | string | File name to save. |
Try it:
For export to SVG use anychart.graphics#server.
Params:
Name | Type | Description |
---|---|---|
width | number | Image width. |
height | number | Image height. |
Try it:
scale
Read more at: anychart.graphics.vector.Element#scale.
Params:
Name | Type | Description |
---|---|---|
sx | number | Scale X. |
sy | number | Scale Y. |
cx | number | Scale center X. |
cy | number | Scale center Y. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.scaleByAnchor
Read more at: anychart.graphics.vector.Element#scaleByAnchor.
Params:
Name | Type | Description |
---|---|---|
sx | number | Scale X. |
sy | number | Scale Y. |
anchor | anychart.graphics.vector.Anchor | string | Scaling center anchor. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.setPosition
Read more at: anychart.graphics.vector.Element#setPosition.
Params:
Name | Type | Description |
---|---|---|
x | number | X of top left corner. |
y | number | Y of top left corner. |
Returns:
anychart.graphics.vector.Stage - Returns self for chaining.setRotation
Read more at: anychart.graphics.vector.Element#setRotation.
Params:
Name | Type | Description |
---|---|---|
degrees | number | Rotation angle. |
cx | number | Rotaion X. |
cy | number | Rotaion Y. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.setRotationByAnchor
Read more at: anychart.graphics.vector.Element#setRotationByAnchor.
Params:
Name | Type | Description |
---|---|---|
degrees | number | Rotation angle. |
anchor | anychart.graphics.vector.Anchor | string | Rotation anchor. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.setTransformationMatrix
Read more at: anychart.graphics.vector.Element#setTransformationMatrix.
Params:
Name | Type | Description |
---|---|---|
m00 | number | Scale X. |
m10 | number | Shear Y. |
m01 | number | Shear X. |
m11 | number | Scale Y. |
m02 | number | Translate X. |
m12 | number | Translate Y. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.shareAsJpg
shareAsPdf
shareAsPng
shareAsSvg
star
Read more at anychart.graphics.vector.primitives#star
Try it:
star10
Read more at anychart.graphics.vector.primitives#star10
Try it:
star4
Read more at anychart.graphics.vector.primitives#star4
Try it:
star5
Read more at anychart.graphics.vector.primitives#star5
Try it:
star6
Read more at anychart.graphics.vector.primitives#star6
Try it:
star7
Read more at anychart.graphics.vector.primitives#star7
Try it:
suspend
To wake Stage up from this state you need to invoke anychart.graphics.vector.Stage#resume.
Suspended rendering is much faster than instant when there are a lot of operations with a Stage.
This method calculates the number of calls and allows to insert constructions correctly (suspend(); suspend(); resume(); resume() - rendering will happen on the last resume()).
Returns:
anychart.graphics.vector.Stage - Stage.Try it:
swapChildren
Similar to anychart.graphics.vector.Layer#swapChildren
Params:
Name | Type | Description |
---|---|---|
element1 | anychart.graphics.vector.Element | First child. |
element2 | anychart.graphics.vector.Element | Second child. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.swapChildrenAt
Similar to anychart.graphics.vector.Layer#swapChildrenAt
Params:
Name | Type | Description |
---|---|---|
index1 | number | First child or id. |
index2 | number | Second child or id. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.text
Note:
anychart.graphics.vector.Stage doesn't delete objects you create. You must delete them yourself after you finish using them.
Params:
Name | Type | Description |
---|---|---|
x | number | X-coordinate (Left) of left top corner of text bounds. |
y | number | Y-coordinate (Top) of left top corner of text bounds. |
text | string | Text. |
style | anychart.graphics.vector.TextStyle | Text style. Read more at anychart.graphics.vector.Text#style. |
Returns:
anychart.graphics.vector.Text - An instance of the class for method chaining.title
Returns:
string | null | undefined - The element title value.Try it:
Params:
Name | Type | Description |
---|---|---|
text | string | null | Title text to set. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.Try it:
toSvg
Params:
Name | Type | Description |
---|---|---|
paperSize | string | Paper Size. |
landscape | boolean | Landscape. |
Returns:
string - SVG content or empty string.Try it:
Params:
Name | Type | Description |
---|---|---|
width | number | Image width. |
height | number | Image height. |
Returns:
string - SVG content or empty string.Try it:
translate
Movement happens in root layer coordinates.
Read more at: anychart.graphics.vector.Element#translate.
Params:
Name | Type | Description |
---|---|---|
tx | number | X offset. |
ty | number | Y offset. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.triangleDown
Read more at anychart.graphics.vector.primitives#triangleDown
Try it:
triangleLeft
Read more at anychart.graphics.vector.primitives#triangleLeft
Try it:
triangleRight
Read more at anychart.graphics.vector.primitives#triangleRight
Try it:
triangleUp
Read more at anychart.graphics.vector.primitives#triangleUp
Try it:
truncatedRect
Read more at anychart.graphics.vector.primitives#truncatedRect
Try it:
unlisten
Params:
Name | Type | Default | Description |
---|---|---|---|
type | string | anychart.graphics.vector.Stage.EventType | The event type name. | |
listener | function(e:Object):boolean|undefined | A function to execute each time the event is triggered. | |
useCapture | boolean | false | Whether to fire in capture phase. capturing |
listenerScope | Object | 'Window' | Object in whose scope to call the listener. |
Returns:
boolean - Whether any listener was removed.Try it:
unlistenByKey
Params:
Name | Type | Description |
---|---|---|
key | Object | The key returned by anychart.graphics.vector.Stage#listen or anychart.graphics.vector.Stage#listenOnce. |
Returns:
boolean - Whether any listener was removed.Try it:
vLine
Read more at anychart.graphics.vector.primitives#vLine
Try it:
visible
Params:
Name | Type | Default | Description |
---|---|---|---|
isVisible | boolean | true | Visibility. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.Try it:
width
Params:
Name | Type | Description |
---|---|---|
width | string | number | Width of stage. |
Returns:
anychart.graphics.vector.Stage - Self instance for method chaining.Try it: