ExportMenu
Type class
Creates a menu for Export operations.
To add an export menu to a chart, set this to a new instance of ExportMenu.
chart.exporting.menu = new am4core.ExportMenu();
chart.exporting.menu = new am4core.ExportMenu();
{
// ...
"exporting": {
"menu": {}
}
}
Sources
ExportMenu can be used (imported) via one of the following packages.
/** * Import from: "core.ts" * Use like: am4core.ExportMenu */import * as am4core from "@amcharts/amcharts4/core";/** * Include via: <script src="core.js"></script> * Access items like: am4core.ExportMenu */Inheritance
ExportMenu extends Validatable.
ExportMenu is not extended by any other symbol.
Properties
adapterType
Adapter<ExportMenu,IExportMenuAdapters>Defaultnew Adapter<ExportMenu, IExportMenuAdapters>(this)An
Adapter.alignType
AlignA horizontal alignment for the menu placement.
classPrefixType
stringDefault"amexport"Class name prefix.
closeDelayType
numberDefault1000How many milliseconds to hold menu/sub-menu open after it loses focus or hover, before auto-closing it.
closeOnClickType
booleanDefaulttrueSince 4.2.2Close the menu automatically when some export operation is triggered.
containerType
$type.Optional<HTMLElement>An HTML container to place the Menu in.
A container must be an HTML element, because menu itself is HTML, and cannot be placed into SVG.
defaultStylesType
booleanDefaulttrueIndicates whether
ExportMenushould load external CSS to style itself.If set to
false, the menu will not be styled, and will rely on some external CSS.elementType
$type.Optional<HTMLElement>Since 4.10.6The main element o fthe menu - usually
<ul>.itemsType
Array<IExportMenuItem>A list of menu items. Can be nested.
languageType
LanguageA
Languageinstance.tabindexType
numberA tab index for the menu.
Tab index will influence the order in which elements on the chart and the whole page are selected when pressing TAB key.
tagType
"ul"|"div"Default"ul"Sets main menu tag to place menu in.
This also sets up how menu items are built.
If you set this to "ul", menu items will be wrapped into
<li>tags.If set to "div", menu items will be wrapped in
<div>tags.verticalAlignType
VerticalAlignA vertical alignment for the menu placement.
5 inherited items
clonedFromType
$type.Optional<this>Inherited fromBaseObjectReference to the original object this object was cloned from. We need to keep this so we can disassociate it from source object when this object is disposed.
configType
objectInherited fromBaseObjectUse this property to set JSON-based config. When set, triggers processing routine, which will go through all properties, and try to apply values, create instances, etc.
Use this with caution, as it is a time-consuming process. It's used for initialchart setup only, not routine operations.
eventsType
EventDispatcher<AMEvent<this,IBaseObjectEvents>>Inherited fromBaseObjectEventsAn
EventDispatcherinstanceidType
$type.Optional<string>Inherited fromBaseObjectSets the user-defined id of the element.
uidType
stringInherited fromBaseObjectReturns object's internal unique ID.
Methods
constructor()Returns
ExportMenuConstructor
dispose()Returns
voidDestroys the menu and all its elements.
draw()Returns
voidDraws the menu based on current items.
Normally, there's no need to call this explicitly. The chart, if it has export menu enabled, will automatically draw the menu.
hideBranch(branch:IExportMenuItem)Returns
voidHides the whole branch of menu.
showBranch(branch:IExportMenuItem)Returns
voidShow the branch of menu.
6 inherited items
clone(cloneId?:string)Returns
thisInherited fromBaseObjectMakes a copy of this object and returns the clone. Try to avoid cloning complex objects like chart, create new instances if you need them.
copyFrom(source:this)Returns
voidInherited fromBaseObjectEventsCopies all parameters from another
Sprite.dispatch(eventType:Key,
data?:any)Returns
voidInherited fromBaseObjectEventsDispatches an event using own event dispatcher. Will automatically populate event data object with event type and target (this element).
It also checks if there are any handlers registered for this sepecific event.
dispatchImmediately(eventType:Key,
data?:any)Returns
voidInherited fromBaseObjectEventsWorks like
dispatch, except event is triggered immediately, without waiting for the next frame cycle.getCurrentThemes()Returns
ITheme[]Inherited fromBaseObjectReturns a list of themes that should be applied to this element. It could either be a list of themes set explicitly on this element, or system-wide.
isDisposed()Returns
booleanInherited fromBaseObjectReturns if this object has been already been disposed.
Events
branchselectedParam { type:
"branchselected", target:ExportMenu, branch:IExportMenuItem}Invoked when menu branch is selected. (either by hover or keyboard)
branchunselectedParam { type:
"branchunselected", target:ExportMenu, branch:IExportMenuItem}Invoked when menu branch is unselected.
closedParam { type:
"closed", target:ExportMenu}Invoked when menu is closed.
enterParam { type:
"enter", target:ExportMenu, branch:IExportMenuItem, event:KeyboardEvent}Invoked when ENTER key is pressed when certain menu item is in focus.
hitParam { type:
"hit", target:ExportMenu, branch:IExportMenuItem, event:MouseEvent|TouchEvent}Invoked when menu item is clicked/tapped.
outParam { type:
"out", target:ExportMenu, branch:IExportMenuItem, event:MouseEvent|TouchEvent}Invoked when menu item is no longer hovered.
overParam { type:
"over", target:ExportMenu, branch:IExportMenuItem, event:MouseEvent|TouchEvent}Invoked when menu item is hovered.
Adapters
alignParam { align:
Align}branchParam { branch:
IExportMenuItem, level:number}classPrefixParam { classPrefix:
string}closeOnClickParam
booleandefaultStylesParam { defaultStyles:
boolean}iconTagParam { tag:
string}itemClassParam { className:
string, level:number, type:...}itemsParam { items:
Array<IExportMenuItem> }itemTagParam { tag:
string}labelClassParam { className:
string, level:number, type:...}labelTagParam { tag:
string}Param { className:
string, level:number}Param { menuElement:
HTMLElement}Param { tag:
string}rederLabelParam { branch:
IExportMenuItem, label:string}tabindexParam { tabindex:
number}verticalAlignParam { verticalAlign:
VerticalAlign}