Skip to content
EliteChart

defineDrawingPlugin

Documentation


Documentation / @elitechart/core / defineDrawingPlugin

code
function defineDrawingPlugin<State>(tool, name?): DrawingPlugin<State>;

Defined in: plugin/helpers.ts:61

Wrap an existing DrawingTool as a DrawingPlugin. Reuses the tool's id and name so registry lookup matches the tool the rest of the chart already knows about.

Type Parameters

State

State

Parameters

tool

DrawingTool<State>

name?

string

Returns

DrawingPlugin<State>

Example

code
import { defineDrawingPlugin } from '@elitechart/core';
import { trendLineTool } from '@elitechart/drawings';
chart.registerPlugin(defineDrawingPlugin(trendLineTool));