-
public class Stage extends JsObject
This class provide tools for cross-browser display with the single interface for both (SVG and VML).Do not invoke constructor directly. Use 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.
-
-
Method Summary
Modifier and Type Method Description static Stageinstantiate()StringgetJsBase()StageaddChild(Element element)Adds an element. StageaddChildAt(Element element, Number index)Adds an element by index. StageappendTransformationMatrix(Number m00, Number m10, Number m01, Number m11, Number m02, Number m12)Combines current transformation with another. voidasyncMode()Getter for the current stage rendering mode. StageasyncMode(Boolean async)Setter for the stage rendering mode. Circlecircle(Number cx, Number cy, Number radius)Invokes anychart.graphics.vector. Rectclip()Gets clip bounds. Stageclip(Rect rect)Clips a stage. voidcontainer()Returns DOM element where everything is drawn upon rendering. ClipcreateClip(Array<Number> rect)Creates a clip element using single value. ClipcreateClip(Rect rect)Creates a clip element using single value. ClipcreateClip(String rect)Creates a clip element using single value. ClipcreateClip(Number left, Number top, Number width, Number height)Creates a clip element using several value. StageCreditscredits()Getter for stage credits. Stagecredits(String settings)Setter for stage credits. Stagecredits(Boolean settings)Setter for stage credits. voidcross()Draws a cross defined by a circumscribed circle. voiddata(List<DataEntry> data)voiddesc()Getter for the element description value. Stagedesc(String text)Setter for the element desc value. voiddiagonalCross()Draws a diagonal cross set by it circumscribed circle center and radius. voiddiamond()Draws a diamond set by it circumscribed circle center and radius. voiddispose()Disposes stage. voiddomElement()Returns stage root DOM element. voiddonut()Draws arc as donut chart element. Ellipseellipse(Number cx, Number cy, Number rx, Number ry)Invokes anychart.graphics.vector. voidfullScreen()Getter for the fullscreen mode. StagefullScreen(Boolean enabled)Setter for the fullscreen mode. RectgetBounds()Returns bounds. ElementgetChildAt(Number index)Returns an element by index. voidgetContainerElement()Returns stage container element. voidgetDomWrapper()Returns a DIV wrapper that contains stage and other utilitarian DOM elements. voidgetRotationAngle()Returns rotation angle in degrees. StagegetStage()Returns self. voidgetTransformationMatrix()Returns current transformation matrix: [ {number} m00 Scale X. voidgetX()Returns X of top left corner. voidgetY()Returns Y of top left corner. voidhLine()Draws a thick horizontal line set by its circumscribed circle center and radius. voidhasChild(Element element)Checks if there is such element in children set. HatchFillhatchFill(HatchFillType type, String color, Number thickness, Number size)Invokes anychart.graphics.vector. voidheight()Getter for the stage height. Stageheight(String height)Setter for a stage height. Stageheight(Number height)Setter for a stage height. voidid()Getter for the stage identifier. Stageid(String id)Setter for a stage identifier. Imageimage(String src, Number x, Number y, Number width, Number height)Invokes anychart.graphics.vector. voidindexOfChild(Element element)Returns index of a child. voidisFullScreenAvailable()Whether the context menu available in the browser or not. voidisRendering()Indicates if stage is in rendering process. voidisSuspended()Returns rendering state (true - suspended, false - instant). Layerlayer()Invokes anychart.graphics.vector. voidmaxResizeDelay()Getter for max delay. StagemaxResizeDelay(Number delay)Setter for max delay. voidnumChildren()A number of stage children. Stageparent()Returns self. Pathpath()Invokes anychart.graphics.vector. PatternFillpattern(Rect bounds)Invokes anychart.graphics.vector. voidpie()Draws arc as pie chart element. voidprint(String paperSizeOrWidth, Boolean landscapeOrHeight)Print stage. voidprint(String paperSizeOrWidth, String landscapeOrHeight)Print stage. voidprint(Number paperSizeOrWidth, Boolean landscapeOrHeight)Print stage. voidprint(Number paperSizeOrWidth, String landscapeOrHeight)Print stage. Rectrect(Number x, Number y, Number width, Number height)Invokes anychart.graphics.vector. Stageremove()Removes everything. voidremoveAllListeners(String type)Removes all listeners from an object. ElementremoveChild(Element element)Removes an element. ElementremoveChildAt(Number index)Removes an element by index. voidremoveChildren()Removes all elements. voidresize(Number width, Number height)Stage resize. voidresize(Number width, String height)Stage resize. voidresize(String width, Number height)Stage resize. voidresize(String width, String height)Stage resize. Stageresume(Boolean force)Removes suspend state and applies all changes in sync (if any). Stagerotate(Number degrees, Number cx, Number cy)Rotates root layer. StagerotateByAnchor(Number degrees, Anchor anchor)Rotates root layer around an anchor. StagerotateByAnchor(Number degrees, String anchor)Rotates root layer around an anchor. voidsaveAsJpg(Number width, Number height, Number quality, Boolean forceTransparentWhite, String filename)Saves the current stage as JPG Image. voidsaveAsPdf(String paperSize, Boolean landscape, Number x, Number y, String filename)Saves the current stage as PDF Document. voidsaveAsPng(Number width, Number height, Number quality, String filename)Saves the current stage as PNG Image. voidsaveAsSvg(String paperSize, Boolean landscape, String filename)Saves the stage as SVG Image. voidsaveAsSvg(Number width, Number height)Saves the stage as SVG Image using width and height. Stagescale(Number sx, Number sy, Number cx, Number cy)Scales root layer in parent coordinates system. StagescaleByAnchor(Number sx, Number sy, Anchor anchor)Scales root layer in parent coordinates system. StagescaleByAnchor(Number sx, Number sy, String anchor)Scales root layer in parent coordinates system. StagesetPosition(Number x, Number y)Sets top left corner coordinates of root layer (with transformation,in parent coordinate system). StagesetRotation(Number degrees, Number cx, Number cy)Rotates root layer around a point. StagesetRotationByAnchor(Number degrees, Anchor anchor)Rotates root layer around an anchor. StagesetRotationByAnchor(Number degrees, String anchor)Rotates root layer around an anchor. StagesetTransformationMatrix(Number m00, Number m10, Number m01, Number m11, Number m02, Number m12)Sets transformation matrix. voidstar()Draws multi-pointed star. voidstar10()Draws ten-pointed star. voidstar4()Draws four-pointed star. voidstar5()Draws five-pointed star. voidstar6()Draws six-pointed star. voidstar7()Draws seven-pointed star. Stagesuspend()Suspends rendering (changes instant to suspended). StageswapChildren(Element element1, Element element2)Swaps two children. StageswapChildrenAt(Number index1, Number index2)Swaps two children by id. voidtitle()Getter for the element title value. Stagetitle(String text)Setter for the element title value. voidtoSvg(String paperSize, Boolean landscape)Returns SVG string if type of content is SVG with parameters otherwise returns empty string. voidtoSvg(Number width, Number height)Returns SVG string if type of content is SVG with determined the width and height otherwise returns empty string. Stagetranslate(Number tx, Number ty)Moves root layer taking transformation into account. voidtriangleDown()Draws a triangle heading downwards set by it circumscribed circle center and radius. voidtriangleLeft()Draws a triangle heading leftwards set by it circumscribed circle center and radius. voidtriangleRight()Draws a triangle heading rightwards set by it circumscribed circle center and radius. voidtriangleUp()Draws a triangle heading upwards set by its circumscribed circle center and radius. voidsetOnClickListener(ListenersInterface.OnClickListener listener)voidsetOnClickListener(ListenersInterface.OnClickListener listener, String type, String ePath)voidunlistenByKey(String key)Removes an event listener which was added with listen by the key returned by listen or listenOnce. voidvLine()Draws a thick vertical line set by its circumscribed circle center and radius. voidvisible()Returns the current stage visibility. Stagevisible(Boolean isVisible)Shows or hides a stage. voidwidth()Getter for the stage width. Stagewidth(String width)Setter for a stage width. Stagewidth(Number width)Setter for a stage width. Stagedata(View data)Stagedata(List<DataEntry> data, TreeFillingMethod fillMethod)Stagedata(List<DataEntry> data, String fillMethod)-
-
Constructor Detail
-
Stage
Stage(String jsChart)
-
-
Method Detail
-
instantiate
static Stage instantiate()
-
addChildAt
Stage addChildAt(Element element, Number index)
Adds an element by index. Similar to addChildAt
-
appendTransformationMatrix
Stage appendTransformationMatrix(Number m00, Number m10, Number m01, Number m11, Number m02, Number m12)
Combines current transformation with another. Combination is done by multiplying matrix to the right. Read more at: appendTransformationMatrix.
-
asyncMode
void asyncMode()
Getter for the current stage rendering mode.
-
circle
Circle circle(Number cx, Number cy, Number radius)
Invokes anychart.graphics.vector.Circle constructor.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
-
container
void container()
Returns DOM element where everything is drawn upon rendering.
-
createClip
Clip createClip(Array<Number> rect)
Creates a clip element using single value.
-
createClip
Clip createClip(Rect rect)
Creates a clip element using single value.
-
createClip
Clip createClip(String rect)
Creates a clip element using single value.
-
createClip
Clip createClip(Number left, Number top, Number width, Number height)
Creates a clip element using several value.
-
credits
StageCredits credits()
Getter for stage credits.
-
credits
Stage credits(String settings)
Setter for stage credits. {docs:Quick_Start/Credits}Learn more about credits settings.{docs}
-
credits
Stage credits(Boolean settings)
Setter for stage credits. {docs:Quick_Start/Credits}Learn more about credits settings.{docs}
-
cross
void cross()
Draws a cross defined by a circumscribed circle. Read more at cross
-
desc
void desc()
Getter for the element description value.
-
diagonalCross
void diagonalCross()
Draws a diagonal cross set by it circumscribed circle center and radius. Read more at diagonalCross
-
diamond
void diamond()
Draws a diamond set by it circumscribed circle center and radius. Read more at diamond
-
dispose
void dispose()
Disposes stage. Removes it from parent layer, nulls links, removes from DOM.
-
domElement
void domElement()
Returns stage root DOM element.
-
donut
void donut()
Draws arc as donut chart element. Read more at donut
-
ellipse
Ellipse ellipse(Number cx, Number cy, Number rx, Number ry)
Invokes anychart.graphics.vector.Ellipse constructor.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
-
fullScreen
void fullScreen()
Getter for the fullscreen mode.
-
fullScreen
Stage fullScreen(Boolean enabled)
Setter for the fullscreen mode.
-
getChildAt
Element getChildAt(Number index)
Returns an element by index. Similar to getChildAt
-
getContainerElement
void getContainerElement()
Returns stage container element.
-
getDomWrapper
void getDomWrapper()
Returns a DIV wrapper that contains stage and other utilitarian DOM elements.
-
getRotationAngle
void getRotationAngle()
Returns rotation angle in degrees. Read more at: getRotationAngle.
-
getTransformationMatrix
void getTransformationMatrix()
Returns current transformation matrix: [ {number} m00 Scale X. {number} m10 Shear Y. {number} m01 Shear X. {number} m11 Scale Y. {number} m02 Translate X. {number} m12 Translate Y. ] Read more at: getTransformationMatrix.
-
getX
void getX()
Returns X of top left corner.
-
getY
void getY()
Returns Y of top left corner.
-
hLine
void hLine()
Draws a thick horizontal line set by its circumscribed circle center and radius. Read more at hLine
-
hasChild
void hasChild(Element element)
Checks if there is such element in children set. Similar to hasChild
-
hatchFill
HatchFill hatchFill(HatchFillType type, String color, Number thickness, Number size)
Invokes anychart.graphics.vector.HatchFill constructor. Note: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
-
height
void height()
Getter for the stage height.
-
id
void id()
Getter for the stage identifier. If it was not set, than it will be generated.
-
image
Image image(String src, Number x, Number y, Number width, Number height)
Invokes anychart.graphics.vector.Image constructor.Note:anychart.graphics.vector.Stage doesn't delete objects you create. You must delete them yourself after you finish using them.
-
indexOfChild
void indexOfChild(Element element)
Returns index of a child. Similar to indexOfChild
-
isFullScreenAvailable
void isFullScreenAvailable()
Whether the context menu available in the browser or not.
-
isRendering
void isRendering()
Indicates if stage is in rendering process.
-
isSuspended
void isSuspended()
Returns rendering state (true - suspended, false - instant).
-
layer
Layer layer()
Invokes anychart.graphics.vector.Layer constructor.Note:anychart.graphics.vector.Stage doesn't delete objects you create. You must delete them yourself after you finish using them.
-
maxResizeDelay
void maxResizeDelay()
Getter for max delay.
-
maxResizeDelay
Stage maxResizeDelay(Number delay)
Setter for max delay.
-
numChildren
void numChildren()
A number of stage children. Similar to numChildren
-
path
Path path()
Invokes anychart.graphics.vector.Path constructor.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
-
pattern
PatternFill pattern(Rect bounds)
Invokes anychart.graphics.vector.PatternFill.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
-
pie
void pie()
Draws arc as pie chart element. Read more at pie
-
rect
Rect rect(Number x, Number y, Number width, Number height)
Invokes anychart.graphics.vector.Rect constructor.Note:anychart.graphics.vector.Stage doesn't delete objects you create. You must delete them yourself after you finish using them.
-
removeAllListeners
void removeAllListeners(String type)
Removes all listeners from an object. You can also optionally remove listeners of some particular type.
-
removeChild
Element removeChild(Element element)
Removes an element. Similar to removeChild
-
removeChildAt
Element removeChildAt(Number index)
Removes an element by index. Similar to removeChildAt
-
removeChildren
void removeChildren()
Removes all elements. Similar to removeChildren
-
resize
void resize(Number width, Number height)
Stage resize. Anything drawn on stage must fit in it. So any part that doesn't fit will be clipped.
-
resize
void resize(Number width, String height)
Stage resize. Anything drawn on stage must fit in it. So any part that doesn't fit will be clipped.
-
resize
void resize(String width, Number height)
Stage resize. Anything drawn on stage must fit in it. So any part that doesn't fit will be clipped.
-
resize
void resize(String width, String height)
Stage resize. Anything drawn on stage must fit in it. So any part that doesn't fit will be clipped.
-
resume
Stage resume(Boolean force)
Removes suspend state and applies all changes in sync (if any). Read more at suspend.
-
rotateByAnchor
Stage rotateByAnchor(Number degrees, Anchor anchor)
Rotates root layer around an anchor. Read more at: rotateByAnchor.
-
rotateByAnchor
Stage rotateByAnchor(Number degrees, String anchor)
Rotates root layer around an anchor. Read more at: rotateByAnchor.
-
saveAsJpg
void saveAsJpg(Number width, Number height, Number quality, Boolean forceTransparentWhite, String filename)
Saves the current stage as JPG Image. For export to image JPG use server.
-
saveAsPdf
void saveAsPdf(String paperSize, Boolean landscape, Number x, Number y, String filename)
Saves the current stage as PDF Document. For export to PDF file use server.
-
saveAsPng
void saveAsPng(Number width, Number height, Number quality, String filename)
Saves the current stage as PNG Image. For export to image PNG use server.
-
saveAsSvg
void saveAsSvg(String paperSize, Boolean landscape, String filename)
Saves the stage as SVG Image. For export to SVG use server.
-
saveAsSvg
void saveAsSvg(Number width, Number height)
Saves the stage as SVG Image using width and height. For export to SVG use server.
-
scale
Stage scale(Number sx, Number sy, Number cx, Number cy)
Scales root layer in parent coordinates system. Scaling center is set in the parent system too. Read more at: scale.
-
scaleByAnchor
Stage scaleByAnchor(Number sx, Number sy, Anchor anchor)
Scales root layer in parent coordinates system. Scaling center is set by root layer anchor. Read more at: scaleByAnchor.
-
scaleByAnchor
Stage scaleByAnchor(Number sx, Number sy, String anchor)
Scales root layer in parent coordinates system. Scaling center is set by root layer anchor. Read more at: scaleByAnchor.
-
setPosition
Stage setPosition(Number x, Number y)
Sets top left corner coordinates of root layer (with transformation,in parent coordinate system). Read more at: setPosition.
-
setRotation
Stage setRotation(Number degrees, Number cx, Number cy)
Rotates root layer around a point. Read more at: setRotation.
-
setRotationByAnchor
Stage setRotationByAnchor(Number degrees, Anchor anchor)
Rotates root layer around an anchor. Read more at: setRotationByAnchor.
-
setRotationByAnchor
Stage setRotationByAnchor(Number degrees, String anchor)
Rotates root layer around an anchor. Read more at: setRotationByAnchor.
-
setTransformationMatrix
Stage setTransformationMatrix(Number m00, Number m10, Number m01, Number m11, Number m02, Number m12)
Sets transformation matrix. Read more at: setTransformationMatrix.
-
star
void star()
Draws multi-pointed star. Read more at star
-
star10
void star10()
Draws ten-pointed star. Read more at star10
-
star4
void star4()
Draws four-pointed star. Read more at star4
-
star5
void star5()
Draws five-pointed star. Read more at star5
-
star6
void star6()
Draws six-pointed star. Read more at star6
-
star7
void star7()
Draws seven-pointed star. Read more at star7
-
swapChildren
Stage swapChildren(Element element1, Element element2)
Swaps two children. Similar to swapChildren
-
swapChildrenAt
Stage swapChildrenAt(Number index1, Number index2)
Swaps two children by id. Similar to swapChildrenAt
-
title
void title()
Getter for the element title value.
-
toSvg
void toSvg(String paperSize, Boolean landscape)
Returns SVG string if type of content is SVG with parameters otherwise returns empty string.
-
toSvg
void toSvg(Number width, Number height)
Returns SVG string if type of content is SVG with determined the width and height otherwise returns empty string.
-
translate
Stage translate(Number tx, Number ty)
Moves root layer taking transformation into account. Movement happens in root layer coordinates. Read more at: translate.
-
triangleDown
void triangleDown()
Draws a triangle heading downwards set by it circumscribed circle center and radius. Read more at triangleDown
-
triangleLeft
void triangleLeft()
Draws a triangle heading leftwards set by it circumscribed circle center and radius. Read more at triangleLeft
-
triangleRight
void triangleRight()
Draws a triangle heading rightwards set by it circumscribed circle center and radius. Read more at triangleRight
-
triangleUp
void triangleUp()
Draws a triangle heading upwards set by its circumscribed circle center and radius. Read more at triangleUp
-
setOnClickListener
void setOnClickListener(ListenersInterface.OnClickListener listener)
-
setOnClickListener
void setOnClickListener(ListenersInterface.OnClickListener listener, String type, String ePath)
-
unlistenByKey
void unlistenByKey(String key)
Removes an event listener which was added with listen by the key returned by listen or listenOnce.
-
vLine
void vLine()
Draws a thick vertical line set by its circumscribed circle center and radius. Read more at vLine
-
visible
void visible()
Returns the current stage visibility.
-
width
void width()
Getter for the stage width.
-
data
Stage data(List<DataEntry> data, TreeFillingMethod fillMethod)
-
-
-
-