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

class anychart.elements.LegendItem Improve this Doc

Extends: anychart.elements.Text

Inner class for representing legend item.

Methods Overview

Miscellaneous
getContentBounds()Return legend item content bounds.
getHeight()Calculating actual height of legend item independently of enabled state.
getTextElement()Legend item text element.
getWidth()Calculating actual width of legend item independently of enabled state.
iconFill()Getter/setter for icon fill setting.
iconHatchFill()Getter/setter for icon fill setting.
iconStroke()Getter/setter for icon stroke setting.
iconTextSpacing()Getter/setter for iconTextSpacing setting.
iconType()Getter/setter for icon type.
maxHeight()Getter/setter for max height of legend item.
maxWidth()Getter/setter for max width of legend item.
parentBounds()Getter/setter for parentBounds.
text()Getter/setter for legend item text.
x()Getter/setter for X coordinate of legend item.
y()Getter/setter for Y coordinate of legend item.

Methods Description

getContentBounds

Return legend item content bounds.

Returns:

anychart.math.Rect - Content bounds.

getHeight

Calculating actual height of legend item independently of enabled state.

Returns:

number - Height.

getTextElement

Legend item text element.

Returns:

anychart.graphics.vector.Text - Text element.

getWidth

Calculating actual width of legend item independently of enabled state.

Returns:

number - Width.

iconFill

Getter/setter for icon fill setting.

Params:

Name Type Description
value anychart.graphics.vector.Fill Icon fill setting.

Returns:

anychart.graphics.vector.Fill anychart.elements.LegendItem - Icon fill setting or self for method chaining.

iconStroke

Getter/setter for icon stroke setting.

Params:

Name Type Description
value anychart.graphics.vector.Stroke Icon stroke setting.

Returns:

anychart.graphics.vector.Stroke anychart.elements.LegendItem - Icon stroke setting or self for method chaining.

iconTextSpacing

Getter/setter for iconTextSpacing setting.

Params:

Name Type Description
value number Value of spacing between icon and text.

Returns:

anychart.elements.LegendItem number - Spacing between icon and text or self for method chaining.

iconType

Getter/setter for icon type.

Params:

Name Type Description
value string | function Icon type or custom drawer function.

Returns:

string function anychart.elements.LegendItem - icon type or drawer function or self for method chaining.

maxHeight

Getter/setter for max height of legend item.

Params:

Name Type Description
value number Max height setting.

Returns:

number anychart.elements.LegendItem - Max height or self for method chaining.

maxWidth

Getter/setter for max width of legend item.

Params:

Name Type Description
value number Max width setting.

Returns:

number anychart.elements.LegendItem - Max width or self for method chaining.

parentBounds

Getter/setter for parentBounds.

Params:

Name Type Description
value anychart.math.Rect Value to set.

Returns:

anychart.math.Rect anychart.elements.LegendItem - Parent bounds or self for method chaining.

text

Getter/setter for legend item text.

Params:

Name Type Description
value string Legend item text.

Returns:

string anychart.elements.LegendItem - Legend item text or self for method chaining.

x

Getter/setter for X coordinate of legend item.

Params:

Name Type Description
value number | string New x coordinate.

Returns:

number string anychart.elements.LegendItem - X coordinate or self for method chaining.

y

Getter/setter for Y coordinate of legend item.

Params:

Name Type Description
value number | string New y coordinate.

Returns:

number string anychart.elements.LegendItem - Y coordinate or self for method chaining.