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

class anychart.ui.Legend Improve this Doc

Methods Overview

Miscellaneous
container()Getter for the legend current container.
draw()Draw legend.
itemsSource()Getter for items source.
parentBounds()Getter for bounds. As a getter falls back to stage bounds.

Methods Description

container

Getter for the legend current container.

Returns:

string Element - The current container.
Setter for the legend container.

Params:

Name Type Description
value string | Element The value to set.

Returns:

anychart.ui.Legend - Self instance for method chaining.

Try it:

draw

Draw legend.

Returns:

anychart.ui.Legend - Self instance for method chaining.

Try it:

itemsSource

Getter for items source.

Returns:

anychart.core.SeparateChart Array.<anychart.core.SeparateChart> - Items source.
Setter for items source.

Params:

Name Type Description
value anychart.core.SeparateChart | Array.<anychart.core.SeparateChart> Items source.

Returns:

anychart.ui.Legend - Self instance for method chaining.

Try it:

parentBounds

Getter for bounds. As a getter falls back to stage bounds.

Returns:

anychart.math.Rect - Current bounds.
Setter for bounds using single value.

Params:

Name Type Description
value anychart.math.Rect | Object | null Value to set

Returns:

anychart.ui.Legend - Self instance for method chaining.

Try it:

Setter for bounds using several value.

Params:

Name Type Description
left number Left space.
top number Top space.
width number A width for a legend.
height number A height for a legend.

Returns:

anychart.ui.Legend - Self instance for method chaining.

Try it: