Skip to content

charton API


charton API / @chart-on/ui / index / createObjectTree

Function: createObjectTree() ​

createObjectTree(host, chart, options?): ObjectTreeHandle

Defined in: ui/src/object-tree.ts:60

Panel listing the chart's panes and, in each, its series, indicators and drawings (topmost drawing first). Rows show, hide, lock, rename, remove and reorder their object through the public chart API, so drawing edits are undo steps and everything saves with the layout like edits made on the chart. Selecting drawing rows selects them on the chart, and the other way round; focusing a selected indicator row selects the indicator.

It follows the tree pattern for assistive technology: one tab stop, arrow keys to move (Shift extends the selection, Ctrl/Cmd moves focus only), Left/Right to collapse and expand panes, Space to toggle a row's selection, Ctrl/Cmd+A for all, Enter or F2 to rename, Delete to remove, H to show or hide, L to lock, Alt+Up/Down to reorder, Ctrl/Cmd+Z and Ctrl/Cmd+Y (or Shift+Z) for undo and redo. Requires @chart-on/ui/style.css.

Parameters ​

host ​

HTMLElement

chart ​

Chart

options? ​

ObjectTreeOptions = {}

Returns ​

ObjectTreeHandle