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

class anychart.core.utils.LegendItemSettings Improve this Doc

Extends: anychart.core.Text

Helper class for maintaining legend item settings for series legend icon

Methods Overview

Miscellaneous
disabled()Getter for disabled settings.
iconEnabled()Getter for settings showing icons.
iconFill()Getter for legend item icon fill settings.
iconHatchFill()Getter for icon hatch fill settings.
iconMarkerFill()Getter for icon marker fill settings.
iconMarkerStroke()Getter for icon marker stroke settings.
iconMarkerType()Getter for marker type.
iconStroke()Getter for legend item icon stroke settings.
iconTextSpacing()Getter for a spacing between icon and text.
iconType()Getter for icon type.
text()Getter for legend item text.

Methods Description

disabled

Getter for disabled settings.

Returns:

boolean - Disabled setting.

Try it:

Setter for disabled settings.

Params:

Name Type Description
value boolean Is this item disabled.

Returns:

anychart.core.utils.LegendItemSettings - Self instance for method chaining.

Try it:

iconEnabled

Getter for settings showing icons.

Returns:

boolean - IconEnabled settings.

Try it:

Setter for settings showing icons.

Params:

Name Type Description
value boolean Whether to show item icon or not.

Returns:

anychart.core.utils.LegendItemSettings - Self instance for method chaining.

Try it:

iconFill

Getter for legend item icon fill settings.

Returns:

anychart.graphics.vector.Fill function - Current fill settings.
Sets fill settings using an object or a string. Learn more about coloring.

Params:

Name Type Description
value anychart.graphics.vector.Fill Color as an object or a string.

Returns:

anychart.core.utils.LegendItemSettings - Self instance for method chaining.
Fill color with opacity.

Params:

Name Type Description
color string Color as a string.
opacity number Color opacity.

Returns:

anychart.core.utils.LegendItemSettings - Self instance for method chaining.

Try it:

Linear gradient fill. Learn more about coloring.

Params:

Name Type Description
keys Array.<(anychart.graphics.vector.GradientKey|string)> Gradient keys.
angle number Gradient angle.
mode boolean | anychart.graphics.vector.Rect | Object Gradient mode.
opacity number Gradient opacity.

Returns:

anychart.core.utils.LegendItemSettings - Self instance for method chaining.

Try it:

Radial gradient fill. Learn more about coloring.

Params:

Name Type Description
keys Array.<(anychart.graphics.vector.GradientKey|string)> Color-stop gradient keys.
cx number X ratio of center radial gradient.
cy number Y ratio of center radial gradient.
mode anychart.graphics.math.Rect If defined then userSpaceOnUse mode, else objectBoundingBox.
opacity number Opacity of the gradient.
fx number X ratio of focal point.
fy number Y ratio of focal point.
opacity number Gradient opacity.

Returns:

anychart.core.utils.LegendItemSettings - Self instance for method chaining.

Try it:

iconHatchFill

Getter for icon hatch fill settings.
Setter for icon hatch fill settings.

Params:

Name Type Description
patternFillOrType anychart.graphics.vector.PatternFill | anychart.graphics.vector.HatchFill | function | anychart.graphics.vector.HatchFill.HatchFillType | string PatternFill or HatchFill instance or type of hatch fill.
color string Color.
thickness number Thickness.
size number Pattern size.

Returns:

anychart.core.utils.LegendItemSettings - Self instance for method chaining.

Try it:

iconMarkerFill

Getter for icon marker fill settings.

Returns:

anychart.graphics.vector.Fill string - Current fill settings.
Setter for icon marker fill settings. Learn more about coloring.

Params:

Name Type Description
fillOrColorOrKeys anychart.graphics.vector.Fill | !Array.<(anychart.graphics.vector.GradientKey|string)> | null Fill, color or gradient keys.
opacityOrAngleOrCx number Color opacity or X ratio of center radial gradient.
modeOrCy number | boolean | anychart.graphics.math.Rect | Object Gradient mode or Y ratio of center radial gradient.
opacityOrMode number | anychart.graphics.math.Rect | Object | null If defined then userSpaceOnUse mode, else objectBoundingBox. Opacity.
opacity number Opacity of the gradient.
fx number X ratio of focal point.
fy number Y ratio of focal point.

Returns:

anychart.core.utils.LegendItemSettings - Self instance for method chaining.

Try it:

iconMarkerStroke

Getter for icon marker stroke settings.

Returns:

anychart.graphics.vector.Stroke string - Current icon marker stroke settings.

Try it:

Setter for icon marker stroke settings.

Params:

Name Type Default Description
value anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null
Stroke settings.
thickness number
1
Line thickness.
dashpattern string
Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCap anychart.graphics.vector.StrokeLineCap
Style of line cap.

Returns:

anychart.core.utils.LegendItemSettings - Self instance for method chaining.

Try it:

iconMarkerType

Getter for marker type.

Returns:

anychart.enums.MarkerType string function - Current marker type.

Try it:

Setter for marker type.

Params:

Name Type Description
value anychart.enums.MarkerType | string | function Marker type.

Returns:

anychart.core.utils.LegendItemSettings - Self instance for method chaining.

Try it:

iconStroke

Getter for legend item icon stroke settings.

Returns:

function anychart.graphics.vector.Stroke - Current settings item icon.
Setter for legend item icon stroke settings. Learn more about stroke settings.

Params:

Name Type Default Description
value anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
Stroke settings.
thickness number
1
Line thickness.
dashpattern string
Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCap anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.utils.LegendItemSettings - Self instance for method chaining.

Try it:

iconTextSpacing

Getter for a spacing between icon and text.

Returns:

number - Current spacing between icon and text.

Try it:

Setter for a spacing between icon and text.

Params:

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

Returns:

anychart.core.utils.LegendItemSettings - Self instance for method chaining.

Try it:

iconType

Getter for icon type.

Returns:

anychart.enums.LegendItemIconType string function - Icon type or drawer function.

Try it:

Setter for icon type.

Params:

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

Returns:

anychart.core.utils.LegendItemSettings - Self instance for method chaining.

Try it:

text

Getter for legend item text.

Returns:

string - Current legend item text.

Try it:

Setter for legend item text.

Params:

Name Type Description
value string Legend item text.

Returns:

anychart.core.utils.LegendItemSettings - Self instance for method chaining.

Try it: