Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • _AmLegend
    • AmLegend

Index

Constructors

constructor

  • Returns AmLegend

Properties

align

align: string

Alignment of legend entries. Possible values are: "left", "center", "right". left

autoMargins

autoMargins: boolean

Used if chart is Serial or XY. In case true, margins of the legend are adjusted and made equal to chart's margins.

default

true

backgroundAlpha

backgroundAlpha: number

Opacity of legend's background. Value range is 0 - 1

backgroundColor

backgroundColor: string

Background color. You should set backgroundAlpha to >0 vallue in order background to be visible.

default

"#FFFFFF"

borderAlpha

borderAlpha: number

Opacity of chart's border. Value range is 0 - 1.

borderColor

borderColor: string

Color of legend's border. You should set borderAlpha >0 in order border to be visible.

default

"#000000"

bottom

bottom: number

In case legend position is set to "absolute", you can set distance from bottom of the chart, in pixels.

color

color: string

Text color. Will use chart's color if not set.

data

data: any[]

This can be used by AmMap only. You can pass array of objects with title, color, markerType values, for example: [{title: "One", color: "#3366CC"},{title: "Two", color: "#FFCC33"}]

equalWidths

equalWidths: boolean

Specifies if each of legend entry should be equal to the most wide entry. Won't look good if legend has more than one line.

default

true

fontSize

fontSize: string

Font size. Will use chart's font size if not set.

horizontalGap

horizontalGap: number

Horizontal space between legend item and left/right border.

labelText

labelText: string

The text which will be displayed in the legend. Tag title will be replaced with the title of the graph. title

left

left: number

In case legend position is set to "absolute", you can set distance from left side of the chart, in pixels.

marginBottom

marginBottom: number

Bottom margin.

marginLeft

marginLeft: number

Left margin. This property will be ignored if chart is Serial or XY and autoMargins property of the legend is true (default).

default

20

marginRight

marginRight: number

Right margin. This property will be ignored if chart is Serial or XY and autoMargins property of the legend is true (default).

default

20

marginTop

marginTop: number

Top margin.

markerBorderAlpha

markerBorderAlpha: number

Marker border opacity 1.

markerBorderColor

markerBorderColor: string

Marker border color. If not set, will use the same color as marker.

markerBorderThickness

markerBorderThickness: number

Thickness of the legend border. The default value (0) means the line will be a "hairline" (1 px). In case marker type is line, this style will be used for line thickness.

default

1

markerDisabledColor

markerDisabledColor: string

The color of the disabled marker (when the graph is hidden). #AAB3B3

markerLabelGap

markerLabelGap: number

Space between legend marker and legend text, in pixels.

default

5

markerSize

markerSize: number

Size of the legend marker (key).

default

16

markerType

markerType: string

Shape of the legend marker (key). Possible values are: "square", "circle", "line", "dashedLine", "triangleUp", "triangleDown", "bubble", "none". square

maxColumns

maxColumns: number

Maximum number of columns in the legend. If Legend's position is set to "right" or "left", maxColumns is automatically set to 1.

position

position: string

Position of a legend. Possible values are: "bottom", "top", "left", "right" and "absolute". In case "absolute", you should set left and top properties too. (this setting is ignored in Stock charts). In case legend is used with AmMap, position is set to "absolute" automatically. bottom

reversedOrder

reversedOrder: boolean

Specifies whether legend entries should be placed in reversed order.

right

right: number

In case legend position is set to "absolute", you can set distance from right side of the chart, in pixels.

rollOverColor

rollOverColor: string

Legend item text color on roll-over. #CC0000

rollOverGraphAlpha

rollOverGraphAlpha: number

When you roll-over the legend entry, all other graphs can reduce their opacity, so that the graph you rolled-over would be distinguished. This style specifies the opacity of the graphs.

default

1

showEntries

showEntries: boolean

You can use this property to turn all the legend entries off.

default

true

spacing

spacing: number

Horizontal space between legend items, in pixels.

default

10

switchColor

switchColor: string

Legend switch color. #FFFFFF

switchType

switchType: string

Legend switch type (in case the legend is switchable). Possible values are "x" and "v". x

switchable

switchable: boolean

Whether showing/hiding of graphs by clicking on the legend marker is enabled or not. In case legend is used with AmMap, this is set to false automatically.

default

true

textClickEnabled

textClickEnabled: boolean

If true, clicking on the text will show/hide balloon of the graph. Otherwise it will show/hide graph/slice, if switchable is set to true.

top

top: number

In case legend position is set to "absolute", you can set distance from top of the chart, in pixels.

useGraphSettings

useGraphSettings: boolean

Legend markers can mirror graph’s settings, displaying a line and a real bullet as in the graph itself. Set this property to true if you want to enable this feature. Note, if you set graph colors in dataProvider, they will not be reflected in the marker.

default

false

useMarkerColorForLabels

useMarkerColorForLabels: boolean

Specifies if legend labels should be use same color as corresponding markers.

valueAlign

valueAlign: string

Alignment of the value text. Possible values are "left" and "right". right

valueText

valueText: string

The text which will be displayed in the value portion of the legend. You can use tags like [[value]], [[open]], [[high]], [[low]], [[close]], percents, description. [[value]]

valueWidth

valueWidth: number

Width of the value text.

default

80

verticalGap

verticalGap: number

Vertical space between legend items also between legend border and first and last legend row.

default:

10

Methods

addListener

  • addListener(type: string, handler: (e: { chart: default; dataItem: object; type: string }) => void): void
  • Adds event listener of the type "clickLabel" or "clickMarker" or "hideItem" to the object.

    Parameters

    • type: string

      Either "clickLabel" or "clickMarker" or "hideItem".

    • handler: (e: { chart: default; dataItem: object; type: string }) => void

      The event handler.

        • (e: { chart: default; dataItem: object; type: string }): void
        • Parameters

          • e: { chart: default; dataItem: object; type: string }
            • chart: default
            • dataItem: object
            • type: string

          Returns void

    Returns void

removeListener

  • removeListener(chart: default, type: string, handler: any): void
  • Removes event listener from chart object.

    Parameters

    • chart: default
    • type: string
    • handler: any

    Returns void

Generated using TypeDoc