charton API / @chart-on/ui / templates / drawingTemplates
Function: drawingTemplates()
drawingTemplates(
options?): (context) => {el:HTMLElement;destroy:void; } |null
Defined in: ui/src/templates.ts:131
Style templates in the drawing settings dialog, as its headerControl: a Template menu in the header. Save as template… asks for a name and saves the style fields as shown; names compare without case, and a taken name is refused. A saved name fills those fields in as a preview, so Ok commits it as one undo step and Cancel drops it; only fields the dialog shows, with a value it accepts, are taken. The names are listed again under Delete, which asks first.
Parameters
options?
Returns
(context) => { el: HTMLElement; destroy: void; } | null
Example
ts
import { createChartShell } from '@chart-on/ui';
import { drawingTemplates } from '@chart-on/ui/templates';
createChartShell(el, { drawingSettings: { headerControl: drawingTemplates() } });