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.

// ExportMenu is available in all of the following modules.
// You only need to import one of them.

/**
 * --------------------------------------------------------
 * Import from: "core.ts"
 * Use like: am4core.ExportMenu
 * --------------------------------------------------------
 */
import * as am4core from "@amcharts/amcharts4/core";

// ExportMenu is available in all of the following modules.
// You only need to import one of them.

/**
 * --------------------------------------------------------
 * 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

adapter
#

Type Adapter < ExportMenu, IExportMenuAdapters >

Default new Adapter<ExportMenu,
IExportMenuAdapters>(this)

An Adapter.

align
#

Type Align

A horizontal alignment for the menu placement.

classPrefix
#

Type string

Class name prefix.

@default "amexport"

clonedFrom
#

Type $type.Optional < this >

Inherited from BaseObject

Reference 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.

closeDelay
#

Type number

Default 1000

How many milliseconds to hold menu/sub-menu open after it loses focus or hover, before auto-closing it.

@default 1000

closeOnClick
#

Type boolean

Default true

Close the menu automatically when some export operation is triggered.

@default true
@since 4.2.2

config
#

Type object

Inherited from BaseObject

Use 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.

container
#

Type $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.

@todo Check if menu is already build. If it is, just move it to a new container

defaultStyles
#

Type boolean

Indicates whether ExportMenu should load external CSS to style itself.

If set to false, the menu will not be styled, and will rely on some external CSS.

@default true

events
#

Type EventDispatcher < AMEvent < this, IExportMenuEvents > >

Default new EventDispatcher()

Inherited from BaseObjectEvents

An EventDispatcher instance

id
#

Type $type.Optional < string >

Inherited from BaseObject

Sets the user-defined id of the element.

items
#

Type Array < IExportMenuItem >

A list of menu items. Can be nested.

language
#

Type Language

A Language instance.

tabindex
#

Type number

A 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.

tag
#

Type "ul" | "div"

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.

@default "ul"

uid
#

Type string

Inherited from BaseObject

Returns object's internal unique ID.

verticalAlign
#

Type VerticalAlign

A vertical alignment for the menu placement.

There are 5 inherited items currently hidden from this list.

Methods

constructor()

#

Returns ExportMenu

Constructor

clone(

cloneId?: string

)

#

Returns this

Inherited from BaseObject

Makes 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 void

Inherited from BaseObjectEvents

Copies all parameters from another Sprite.

dispatch(

eventType: Key,
data?: any

)

#

Returns void

Inherited from BaseObjectEvents

Dispatches 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 void

Inherited from BaseObjectEvents

Works like dispatch, except event is triggered immediately, without waiting for the next frame cycle.

dispose()

#

Returns void

Destroys the menu and all its elements.

draw()

#

Returns void

Draws 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.

getCurrentThemes()

#

Returns ITheme[]

Inherited from BaseObject

Returns 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.

hideBranch(

branch: IExportMenuItem

)

#

Returns void

Hides the whole branch of menu.

isDisposed()

#

Returns boolean

Inherited from BaseObject

Returns if this object has been already been disposed.

showBranch(

branch: IExportMenuItem

)

#

Returns void

Show the branch of menu.

There are 6 inherited items currently hidden from this list.

Events

#branchselected

Param { type: "branchselected",
  target: this }

Invoked when menu branch is selected. (either by hover or keyboard)

#branchunselected

Param { type: "branchunselected",
  target: this }

Invoked when menu branch is unselected.

#closed

Param { type: "closed",
  target: this }

Invoked when menu is closed.

#enter

Param { type: "enter",
  target: this }

Invoked when ENTER key is pressed when certain menu item is in focus.

#hit

Param { type: "hit",
  target: this }

Invoked when menu item is clicked/tapped.

#out

Param { type: "out",
  target: this }

Invoked when menu item is no longer hovered.

#over

Param { type: "over",
  target: this }

Invoked when menu item is hovered.

Adapters

#align

Param object

#branch

Param object

#classPrefix

Param object

#closeOnClick

Param boolean

#defaultStyles

Param object

#iconTag

Param object

#itemClass

Param object

#itemTag

Param object

#items

Param object

#labelClass

Param object

#labelTag

Param object

#menuClass

Param object

#menuElement

Param object

#menuTag

Param object

#rederLabel

Param object

#tabindex

Param object

#verticalAlign

Param object