Skip to content

StockLegend

Type class

StockLegend is a legend of StockPanel.

Sources

This information about StockLegend is provided for reference only and is not available through exported packages and thus should not be imported or used on its own.

Inheritance

StockLegend extends AmLegend.

StockLegend is not extended by any other symbol.

Properties

valueTextComparing

Type stringDefault [[percents.value]]%

The text which will be displayed in the value portion of the legend when graph is comparable and at least one dataSet is selected for comparing. You can use tags like value, open, high, low, close, percents.value/open/close/low/high, description.

valueTextRegular

Type stringDefault [[value]]

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.

44 inherited items
align

Type stringDefault leftInherited from AmLegend

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

autoMargins

Type booleanDefault trueInherited from AmLegend

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

backgroundAlpha

Type numberDefault 0Inherited from AmLegend

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

backgroundColor

Type stringDefault #FFFFFFInherited from AmLegend

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

borderAlpha

Type numberDefault 0Inherited from AmLegend

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

borderColor

Type stringDefault #000000Inherited from AmLegend

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

bottom

Type numberInherited from AmLegend

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

color

Type Hex stringInherited from AmLegend

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

data

Type arrayInherited from AmLegend

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

Type booleanDefault trueInherited from AmLegend

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.

fontSize

Type numberInherited from AmLegend

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

horizontalGap

Type numberDefault 0Inherited from AmLegend

Horizontal space between legend item and left/right border.

labelText

Type stringDefault [[title]]Inherited from AmLegend

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

left

Type numberInherited from AmLegend

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

marginBottom

Type numberDefault 0Inherited from AmLegend

Bottom margin.

marginLeft

Type numberDefault 20Inherited from AmLegend

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

marginRight

Type numberDefault 20Inherited from AmLegend

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

marginTop

Type numberDefault 0Inherited from AmLegend

Top margin.

markerBorderAlpha

Type numberDefault 1Inherited from AmLegend

Marker border opacity.

markerBorderColor

Type Hex stringInherited from AmLegend

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

markerBorderThickness

Type numberDefault 1Inherited from AmLegend

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.

markerDisabledColor

Type Hex stringDefault #AAB3B3Inherited from AmLegend

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

markerLabelGap

Type numberDefault 5Inherited from AmLegend

Space between legend marker and legend text, in pixels.

markerSize

Type numberDefault 16Inherited from AmLegend

Size of the legend marker (key).

markerType

Type stringDefault squareInherited from AmLegend

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

maxColumns

Type numberInherited from AmLegend

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

position

Type stringDefault bottomInherited from AmLegend

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.

reversedOrder

Type booleanDefault falseInherited from AmLegend

Specifies whether legend entries should be placed in reversed order.

right

Type numberInherited from AmLegend

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

rollOverColor

Type stringDefault #CC0000Inherited from AmLegend

Legend item text color on roll-over.

rollOverGraphAlpha

Type numberDefault 1Inherited from AmLegend

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.

showEntries

Type booleanDefault trueInherited from AmLegend

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

spacing

Type numberDefault 10Inherited from AmLegend

Horizontal space between legend items, in pixels.

switchable

Type booleanDefault trueInherited from AmLegend

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.

switchColor

Type Hex stringDefault #FFFFFFInherited from AmLegend

Legend switch color.

switchType

Type stringDefault xInherited from AmLegend

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

textClickEnabled

Type booleanDefault falseInherited from AmLegend

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

Type numberInherited from AmLegend

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

useMarkerColorForLabels

Type booleanDefault falseInherited from AmLegend

Labels will use marker color if you set this to true.

useMarkerColorForValues

Type booleanDefault falseInherited from AmLegend

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

valueAlign

Type stringDefault rightInherited from AmLegend

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

valueText

Type stringDefault [[value]]Inherited from AmLegend

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.

valueWidth

Type numberDefault 80Inherited from AmLegend

Width of the value text.

verticalGap

Type numberDefault 10Inherited from AmLegend

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

Methods

2 inherited items
addListener()

Returns voidInherited from AmLegend

Adds event listener to the object.

type - string like 'clickLabel' (should be listed in 'events' section of this class or classes which extend this class). handler - function which is called when event happens

removeListener()

Returns voidInherited from AmLegend

Removes event listener from the legend object.

Events

clickLabel

Param { type: "clickLabel", target: StockLegend } & {type:"clickLabel", dataItem:Object, chart:AmChart}

Dispatched when legend label is clicked.

clickMarker

Param { type: "clickMarker", target: StockLegend } & {type:"clickMarker", dataItem:Object, chart:AmChart}

Dispatched when legend marker is clicked.

hideItem

Param { type: "hideItem", target: StockLegend } & {type:"hideItem", dataItem:Object, chart:AmChart}

Dispatched when user clicks on a legend item marker and hides corresponding object.

rollOutItem

Param { type: "rollOutItem", target: StockLegend } & {type:"rollOutItem", dataItem:Object, chart:AmChart}

Dispatched when user rolls-out of the legend item label (or whole item, if switchable is set to false).

rollOverItem

Param { type: "rollOverItem", target: StockLegend } & {type:"rollOverItem", dataItem:Object, chart:AmChart}

Dispatched when user rolls-over the legend item label (or whole item, if switchable is set to false).

rollOverMarker

Param { type: "rollOverMarker", target: StockLegend } & {type:"rollOverMarker", dataItem:Object, chart:AmChart}

Dispatched when user rolls-over the legend item marker.

showItem

Param { type: "showItem", target: StockLegend } & {type:"showItem", dataItem:Object, chart:AmChart}

Dispatched when user clicks on a legend item marker and shows corresponding object.