Skip to content
EliteChart

DrawingContextMenu

Documentation


Documentation / @elitechart/core / DrawingContextMenu

Defined in: ui/drawing-context-menu.ts:128

Right-click context menu for a selected drawing. Mounts into a supplied container; the chart calls showFor(binding, pos) on pointer events.

Example

code
const menu = new DrawingContextMenu({ mount: chartContainer });
menu.showFor(binding, { x: 240, y: 180 });
// on dispose:
menu.destroy();

Constructors

Constructor

code
new DrawingContextMenu(config): DrawingContextMenu;

Defined in: ui/drawing-context-menu.ts:134

Parameters

config

DrawingContextMenuConfig

Returns

DrawingContextMenu

Accessors

element

Get Signature

code
get element(): HTMLElement;

Defined in: ui/drawing-context-menu.ts:174

Testing hook.

Returns

HTMLElement


visible

Get Signature

code
get visible(): boolean;

Defined in: ui/drawing-context-menu.ts:169

Whether the menu is currently open.

Returns

boolean

Methods

close()

code
close(): void;

Defined in: ui/drawing-context-menu.ts:162

Close the menu.

Returns

void


destroy()

code
destroy(): void;

Defined in: ui/drawing-context-menu.ts:178

Returns

void


showFor()

code
showFor(binding, pos): void;

Defined in: ui/drawing-context-menu.ts:144

Show the menu at pos (local to the mount) for the bound drawing.

Parameters

binding

DrawingContextMenuBinding

pos

ContextMenuPosition

Returns

void