Events, history and advanced APIs
Chart events, undo history and lower-level APIs for advanced integrations.
Subscribe to events to follow what the chart is doing, and use commands to change it. Keep the chart's internal objects out of your code.
Subscriptions
For every widget.subscribe(event, callback), call unsubscribe later with the same callback. Chart subscription handles take the documented owner and callback arguments. Keep a list of what to clean up, and unsubscribe when the chart or component goes away.
Screenshots
Use the public screenshot API, and check what it actually returns. Uploading screenshots to a server needs a service you set up. Capturing the canvas doesn't give you a shareable URL by itself. Images from other origins can also stop the canvas from being exported.
History checkpoints
The optional history command API lets you export and restore a versioned checkpoint of the chart's undo history. This is separate from saving the chart itself. Checkpoints have limits on the number of actions and their size, and they may stop at an action that isn't supported. Restore the saved chart first, then check that the chart's identity and current state match before you restore its history.
Automation SDK
Use the optional automation SDK for typed command sessions, bounded local data, PNG capture and custom extensions. Native command owners require explicit add-on loading. Model providers, uploads and remote persistence remain host integrations.
External command interfaces
The workspace, drawing, study and history command factories tell your app which commands are available. They need a stable link to a specific chart and versioned inputs. The internal worker protocol and the Nuxt app's own services aren't general browser APIs, so don't build on them.
Performance
Measure startup, interaction and cleanup in your real app. Keep history requests to a reasonable size, don't rebuild charts when unrelated UI state changes, and release subscriptions. Good performance with sample data doesn't guarantee the same with every real market dataset.