Drawings
The external adapter can persist drawings so annotations stay attached to the symbol or chart state.
What The Library Saves
Drawings are captured when users create, update, or remove them on the chart.
The adapter side supports methods such as:
saveDrawing(drawing)loadDrawings(symbol)getAllDrawings()updateDrawing(drawing)removeDrawing(drawingId)
How It Is Managed
The chart uses a drawings persistence bridge to connect drawing events to the adapter.
That bridge:
- listens for drawing create, update, and remove events
- saves changes to the external adapter
- reloads drawings when the symbol changes
- keeps drawing state attached to the right market context
The bridge works with the active symbol, so drawings are stored and restored by symbol instead of being treated as one global list.
Why Symbol-Based Storage Matters
Drawings are often specific to a symbol.
For example:
- a trend line on
AAPLshould not appear onMSFT - a note drawn on a futures contract should stay with that contract
- a symbol change should restore the correct drawing set