Skip to content
EliteChart

DrawingContextMenuBinding

Documentation


Documentation / @elitechart/core / DrawingContextMenuBinding

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

Actions provided per-invocation — the chart builds one of these for each right-click on a drawing, then calls menu.showFor(binding, pos).

Example

code
const binding: DrawingContextMenuBinding = {
  drawingId: id,
  locked: false,
  onDuplicate: () => chart.duplicateDrawing(id),
  onBringToFront: () => chart.bringDrawingToFront(id),
  onSendToBack: () => chart.sendDrawingToBack(id),
  onLockToggle: () => chart.setDrawingLocked(id, true),
  onDelete: () => chart.removeDrawing(id),
};

Properties

drawingId

code
readonly drawingId: string;

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


locked

code
readonly locked: boolean;

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


supportsAlert?

code
readonly optional supportsAlert?: boolean;

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

When true, the menu shows a "Create alert here" row that creates an alert anchored to this drawing. The alert auto-updates its price as the drawing is moved. Chart decides which drawing tools support this (typically horizontal-line + price-label — ones with a single representative price).

Methods

onBringToFront()

code
onBringToFront(): void;

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

Returns

void


onCreateAlert()?

code
optional onCreateAlert(): void;

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

Returns

void


onDelete()

code
onDelete(): void;

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

Returns

void


onDuplicate()

code
onDuplicate(): void;

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

Returns

void


onLockToggle()

code
onLockToggle(): void;

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

Returns

void


onSendToBack()

code
onSendToBack(): void;

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

Returns

void