charton API / @chart-on/core / index / perSymbolDrawings
Function: perSymbolDrawings()
perSymbolDrawings(
chart,storage,options?):PerSymbolDrawings
Defined in: packages/core/src/storage/drawings.ts:48
Keep drawings per symbol through storage. When the chart switches to another symbol, the old symbol's drawings are saved and cleared, and the new symbol's are loaded. Edits save debounced, with the ids that changed. Loading never saves. Switching intervals keeps the drawings. When a symbol's drawings fail to load, nothing saves under its key until the next switch, so the stored drawings are not overwritten. The binding stops on chart destruction; flush first to keep pending edits.
Clearing on a switch removes drawings added with persist: false too; add yours again on data:loaded. Save layouts with serializeLayout({ drawings: false }) (or autosave's serialize option) so they don't hold drawings as well.