charton API / @chart-on/ui / index / createDrawingToolbar
Function: createDrawingToolbar()
createDrawingToolbar(
chart,options?):DrawingToolbarHandle
Defined in: ui/src/drawing-toolbar.ts:77
Floating toolbar for the selected drawing. It shows the drawing's quick style fields (chart.drawings.quickFields), the rest of the fields its tool honors (styleFields) in a "More style" popover, a levels editor for level-based tools, then lock, clone, delete, group or ungroup and, with onSettings, a Settings button that replaces the "More style" popover. Follows the drawing and hides when it is deselected or out of view. With several drawings selected, the fields are those of the last one selected, and every edit applies to each selected drawing whose tool honors the field; lock, clone and delete act on them all. Edits go through chart.drawings.update, so they persist via drawings:change and are undoable (one step for all the drawings); dragging across a color picker previews live and commits once. Arrow and +/-/= keys stay in the toolbar; Escape, Delete and undo/redo shortcuts reach the chart.