Top
You are looking at an outdated 7.7.0 version of this document. Switch to the 8.0.1 version to see the up to date information.

class anychart.core.VisualBase Improve this Doc

Extends: anychart.core.Base

Base class for all elements.

Methods Overview

Export
print()Prints all element.
saveAsJpg()Saves into JPEG file.
saveAsPdf()Saves into PDF file.
saveAsPng()Saves into PNG file.
saveAsSvg()Saves into SVG file.
toSvg()Returns SVG string.
Interactivity
enabled()Element state (enabled or disabled).
Size and Position
zIndex()Z-index of the element.

Methods Description

enabled

Getter for the current element state (enabled or disabled).

Returns:

boolean - The current element state.

Try it:

Setter for the element enabled state.

Params:

Name Type Default Description
value boolean
true
Value to set.

Returns:

anychart.core.VisualBase - Self instance for method chaining.
Example.
if (!element.enabled())
   element.enabled(true);

Try it:

print

Prints all element on related stage.

Params:

Name Type Default Description
paperSize anychart.graphics.vector.PaperSize
Paper size.
landscape boolean
false
Flag of landscape.

Try it:

saveAsJpg

Saves the current visual state into JPEG file.

Params:

Name Type Description
width number Image width.
height number Image height.
quality number Image quality in ratio 0-1.
forceTransparentWhite boolean Define, should we force transparent to white background.

Try it:

saveAsPdf

Saves the current visual state into PDF file.

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.

Try it:

saveAsPng

Saves the current visual state into PNG file.

Params:

Name Type Description
width number Image width.
height number Image height.
quality number Image quality in ratio 0-1.

Try it:

saveAsSvg

Saves the current visual state into SVG file with a paper size and landscape settings.

Params:

Name Type Description
paperSize string Paper Size.
landscape boolean Landscape.

Try it:

Saves the current visual state into SVG file image width and height.

Params:

Name Type Description
width number Image width.
height number Image height.

Try it:

toSvg

Returns SVG string if type of content SVG with parameters otherwise returns empty string.

Params:

Name Type Description
paperSize string Paper Size.
landscape boolean Landscape.

Returns:

string - SVG string or empty string.

Try it:

Returns SVG string if type of content SVG with determined the width and height otherwise returns empty string.

Params:

Name Type Description
width number Paper Size or width.
height number Landscape or height.

Returns:

string - SVG string or empty string.

Try it:

zIndex

Getter for the current Z-index of the element.

Returns:

number - The current zIndex.

Try it:

Setter for the Z-index of the element.

Params:

Name Type Default Description
value number
0
Value to set.

Returns:

anychart.core.VisualBase - Self instance for method chaining.

Try it: