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
valueTextComparingType
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.valueTextRegularType
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
alignType
stringDefaultleftInherited fromAmLegendAlignment of legend entries. Possible values are: "left", "center", "right".
autoMarginsType
booleanDefaulttrueInherited fromAmLegendUsed if chart is Serial or XY. In case true, margins of the legend are adjusted and made equal to chart's margins.
backgroundAlphaType
numberDefault0Inherited fromAmLegendOpacity of legend's background. Value range is 0 - 1
backgroundColorType
stringDefault#FFFFFFInherited fromAmLegendBackground color. You should set backgroundAlpha to >0 vallue in order background to be visible.
borderAlphaType
numberDefault0Inherited fromAmLegendOpacity of chart's border. Value range is 0 - 1.
borderColorType
stringDefault#000000Inherited fromAmLegendColor of legend's border. You should set borderAlpha >0 in order border to be visible.
bottomType
numberInherited fromAmLegendIn case legend position is set to "absolute", you can set distance from bottom of the chart, in pixels.
colorType
Hex stringInherited fromAmLegendText color. Will use chart's color if not set.
dataType
arrayInherited fromAmLegendThis 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"}]
equalWidthsType
booleanDefaulttrueInherited fromAmLegendSpecifies if each of legend entry should be equal to the most wide entry. Won't look good if legend has more than one line.
fontSizeType
numberInherited fromAmLegendFont size. Will use chart's font size if not set.
horizontalGapType
numberDefault0Inherited fromAmLegendHorizontal space between legend item and left/right border.
labelTextType
stringDefault[[title]]Inherited fromAmLegendThe text which will be displayed in the legend. Tag
titlewill be replaced with the title of the graph.leftType
numberInherited fromAmLegendIn case legend position is set to "absolute", you can set distance from left side of the chart, in pixels.
marginBottomType
numberDefault0Inherited fromAmLegendBottom margin.
marginLeftType
numberDefault20Inherited fromAmLegendLeft margin. This property will be ignored if chart is Serial or XY and autoMargins property of the legend is true (default).
marginRightType
numberDefault20Inherited fromAmLegendRight margin. This property will be ignored if chart is Serial or XY and autoMargins property of the legend is true (default).
marginTopType
numberDefault0Inherited fromAmLegendTop margin.
markerBorderAlphaType
numberDefault1Inherited fromAmLegendMarker border opacity.
markerBorderColorType
Hex stringInherited fromAmLegendMarker border color. If not set, will use the same color as marker.
markerBorderThicknessType
numberDefault1Inherited fromAmLegendThickness 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.
markerDisabledColorType
Hex stringDefault#AAB3B3Inherited fromAmLegendThe color of the disabled marker (when the graph is hidden).
markerLabelGapType
numberDefault5Inherited fromAmLegendSpace between legend marker and legend text, in pixels.
markerSizeType
numberDefault16Inherited fromAmLegendSize of the legend marker (key).
markerTypeType
stringDefaultsquareInherited fromAmLegendShape of the legend marker (key). Possible values are: "square", "circle", "line", "dashedLine", "triangleUp", "triangleDown", "bubble", "none".
maxColumnsType
numberInherited fromAmLegendMaximum number of columns in the legend. If Legend's position is set to "right" or "left", maxColumns is automatically set to 1.
positionType
stringDefaultbottomInherited fromAmLegendPosition 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.
reversedOrderType
booleanDefaultfalseInherited fromAmLegendSpecifies whether legend entries should be placed in reversed order.
rightType
numberInherited fromAmLegendIn case legend position is set to "absolute", you can set distance from right side of the chart, in pixels.
rollOverColorType
stringDefault#CC0000Inherited fromAmLegendLegend item text color on roll-over.
rollOverGraphAlphaType
numberDefault1Inherited fromAmLegendWhen 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.
showEntriesType
booleanDefaulttrueInherited fromAmLegendYou can use this property to turn all the legend entries off.
spacingType
numberDefault10Inherited fromAmLegendHorizontal space between legend items, in pixels.
switchableType
booleanDefaulttrueInherited fromAmLegendWhether 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.
switchColorType
Hex stringDefault#FFFFFFInherited fromAmLegendLegend switch color.
switchTypeType
stringDefaultxInherited fromAmLegendLegend switch type (in case the legend is switchable). Possible values are "x" and "v".
textClickEnabledType
booleanDefaultfalseInherited fromAmLegendIf 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.
topType
numberInherited fromAmLegendIn case legend position is set to "absolute", you can set distance from top of the chart, in pixels.
useMarkerColorForLabelsType
booleanDefaultfalseInherited fromAmLegendLabels will use marker color if you set this to true.
useMarkerColorForValuesType
booleanDefaultfalseInherited fromAmLegendSpecifies if legend values should be use same color as corresponding markers.
valueAlignType
stringDefaultrightInherited fromAmLegendAlignment of the value text. Possible values are "left" and "right".
valueTextType
stringDefault[[value]]Inherited fromAmLegendThe text which will be displayed in the value portion of the legend. You can use tags like
value,open,high,low,close,percents,description.valueWidthType
numberDefault80Inherited fromAmLegendWidth of the value text.
verticalGapType
numberDefault10Inherited fromAmLegendVertical space between legend items also between legend border and first and last legend row.
Methods
2 inherited items
addListener()Returns
voidInherited fromAmLegendAdds 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 fromAmLegendRemoves event listener from the legend object.
Events
clickLabelParam { type:
"clickLabel", target:StockLegend} &{type:"clickLabel", dataItem:Object, chart:AmChart}Dispatched when legend label is clicked.
clickMarkerParam { type:
"clickMarker", target:StockLegend} &{type:"clickMarker", dataItem:Object, chart:AmChart}Dispatched when legend marker is clicked.
hideItemParam { type:
"hideItem", target:StockLegend} &{type:"hideItem", dataItem:Object, chart:AmChart}Dispatched when user clicks on a legend item marker and hides corresponding object.
rollOutItemParam { 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).
rollOverItemParam { 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).
rollOverMarkerParam { type:
"rollOverMarker", target:StockLegend} &{type:"rollOverMarker", dataItem:Object, chart:AmChart}Dispatched when user rolls-over the legend item marker.
showItemParam { type:
"showItem", target:StockLegend} &{type:"showItem", dataItem:Object, chart:AmChart}Dispatched when user clicks on a legend item marker and shows corresponding object.