Skip to main content

Drawings API

Drawings are created by users from the toolbar or by hosts through the drawing APIs; both paths produce the same persisted drawing objects.

Search 29 supported drawings contracts below. Expand a result to see its TypeScript declaration, properties, methods, parameters, return values, and errors. Share a filtered URL or a symbol anchor when another engineer needs the same contract.

Start here

  • DrawingDefinition — Serializable description of a single drawing: its tool type, data-space anchor points, styles, and placement/visibility flags.
  • DrawingPoint — One data-space anchor point of a drawing, addressed on the time axis by bar timestamp or data index and on the value axis by price.
  • MarkerDefinition — One chart marker/annotation placed in data space — the agnostic primitive that trading, replay, backtest, and host features all render through.
  • Drawing tools overview
  • Persist and restore drawings

Browse the reference

Interfaces 20

Live native handle for an existing drawing. It is an ergonomic wrapper around the typed TradeScript drawing APIs; it does not expose renderer internals or renderer-specific line-data-source objects.
Serializable description of a single drawing: its tool type, data-space anchor points, styles, and placement/visibility flags. Hosts use it to create drawings programmatically, and it is the element type of DrawingSnapshot used for persistence, templates, and the drawings-change event.
Feature switches for the drawing subsystem, supplied as features.drawings in widget options; passing false there disables drawings entirely, while this object form tunes individual drawing surfaces.
Filter for ChartApi.removeDrawings. Matchers are ANDed; omit all to match everything.
Drawing-handle (selection control-point) style configuration. Every drawing tool renders its control-point handles as small solid circles. By default they are solid DEFAULT_DRAWING_HANDLE_COLOR dots with a faint ring, consistent across all tools. Consumers who want a different handle look can pass a DrawingHandleStyle to the chart via customization().applyStyleOverrides({ handles }) (or styleOverrides.handles in the initial state); it is compiled to the engine's drawingVisuals.point style by buildDrawingPointStyle. Only the fields you set are overridden — anything omitted is derived from color (ring + active state) so a single { color } gives a coherent handle.
Broad persistence-oriented partial update applied to an existing drawing (for example via ChartDrawingHandle.update); only the supplied fields change. For catalog-validated, deep-merged property edits use DrawingPropertiesPatch instead.
One data-space anchor point of a drawing, addressed on the time axis by bar timestamp or data index and on the value axis by price.
Strict native properties patch for existing drawings. Unlike the broad persistence-oriented DrawingPatch, style fields are validated against the drawing tool catalog and nested styles / metadata records are deep merged so a partial property edit does not erase sibling state.
Result of applying the host's drawing-tool visibility and availability policy to one tool.
One drawing-tool catalog entry paired with its resolved access decision.
Catalog entry describing one drawing tool: its identity, toolbar presentation, and the editable style fields drawings created with it expose. The shipped drawing tool catalog is a list of these, letting hosts build their own drawing UIs against it.
Overrides deep-merged into the clone created by ChartDrawingHandle.duplicate; any DrawingDefinition field may be overridden, and id optionally fixes the new drawing's id instead of letting the SDK allocate the next stable one.
Configuration for the built-in unavailable-market-data state shown when a symbol fails to resolve or initial history fails to load. Passed as the object form of the invalidSymbol feature flag to control the illustration, copy, and symbol-search action.
Configuration for the saved chart-layout storage feature, passed as the object form of the layoutStorage feature flag. Gates the built-in toolbar UI and which chart-layout operations (save, load, delete) are available.
One chart marker/annotation placed in data space — the agnostic primitive that trading, replay, backtest, and host features all render through. Created via ChartApi.addMarker/setMarkers and drawn by the shipped tsMarker overlay.
Scope selector for bulk marker operations (ChartApi.setMarkers/getMarkers/clearMarkers).
Partial update applied to an existing marker via ChartApi.updateMarker; every field of MarkerDefinition is optional and only the supplied fields change.
One data-space anchor point of a marker, addressed on the time axis by bar timestamp or data index and on the value axis by price.
Visual styling of a marker rendered by the tsMarker overlay: primary, background, border, and text colors plus size, opacity, and stroke settings for line/box geometries.
Configures per-user settings persistence via the features.userSettings option, controlling whether the feature is active and whether preferences persist outside chart layout JSON.

Type aliases 8

Authoritative drawing persistence policy for chart layouts: embedded keeps drawings inside the chart-layout payload, separate omits them from chart layouts and hands ownership to the drawing storage contract, and both writes both places with separately stored drawings taking precedence when a chart layout is restored.
Persistence scope shared by legacy and SDK drawing definitions.
A serializable snapshot of every drawing on a chart, used for persistence, layout/template round-trips, and the drawings-change event. It is a typed list of DrawingDefinition so customers can inspect and transform drawings without reaching into engine internals.
Resolves the access decision for an exact public drawing-tool identifier.
Where a point marker sits relative to its anchor point.
Vector icons a marker can draw. The SDK's own icon catalog, shared with the market-event badges — so a filing pinned to price and a filing on the time scale use the same artwork.
Geometry class of a marker. point/label use one point; line/box use two.
Agnostic marker / annotation primitive. One shape vocabulary that any feature drives — trading positions, replay events, backtest signals, or plain user annotations — instead of bespoke per-feature overlays. Markers are placed in data space (MarkerPoint) and rendered by the shipped tsMarker overlay; group namespaces them so a feature can bulk replace only its own markers via ChartApi.setMarkers.

Constants 1

The standard handle color — a clean professional blue. This is the app-wide accent used for control-point dots, arrow-mark resize handles and image handles.