AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.core.VisualBase Improve this Doc

Extends: anychart.core.Base

Base class for all elements.

Methods Overview

Export
print()Prints all elements.
Interactivity
enabled()Element state (enabled or disabled).
Size and Position
zIndex()Z-index of the element.
Miscellaneous
container()Container for the elements.
parentBounds()Getter for the parent bounds.

Methods Description

container

Getter for the container.

Returns:

anychart.graphics.vector.Layer | anychart.graphics.vector.Stage - An instance of the class for method chaining.
Setter for the container.

Params:

NameTypeDescription
elementanychart.graphics.vector.Layer | anychart.graphics.vector.Stage | string | ElementThe value to set.

Returns:

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

enabled

Getter for the element state (enabled or disabled).

Returns:

boolean - Element state.
Setter for the element enabled state.

Params:

NameTypeDefaultDescription
enabledboolean
true
Enabled state to set.

Returns:

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

parentBounds

Getter for the parent bounds.
Bounds that would be used in case of percent size calculations. Expects pixel values only.

Returns:

anychart.math.Rect - The parent bounds of the element.
Setter for the parent bounds using single value.
Bounds that would be used in case of percent size calculations. Expects pixel values only.

Params:

NameTypeDescription
boundsanychart.math.Rect | Object | number | nullBounds to set.

Returns:

anychart.core.VisualBase - Self instance for method chaining.
Setter for the parent bounds using several values.
Bounds that would be used in case of percent size calculations. Expects pixel values only.

Params:

NameTypeDescription
leftnumberLeft space.
topnumberTop space.
widthnumberElement width.
heightnumberElement height.

Returns:

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

print

Prints all elements on related stage.

Params:

NameTypeDefaultDescription
paperSizeOrOptionsanychart.graphics.vector.PaperSize | Object
Paper size or object with options.
landscapeboolean
false
Flag of landscape.

zIndex

Getter for the Z-index of the element.

Returns:

number - Z-index.
Setter for the Z-index of the element.

Params:

NameTypeDefaultDescription
zIndexnumber
0
Value to set.

Returns:

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