interface Drawing {
    createdAt?: number;
    id: string;
    intervals?: DrawingIntervalRange;
    locked?: boolean;
    paneIndex: number;
    points: DrawingPoint[];
    policy?: DrawingPolicy;
    props?: Record<string, unknown>;
    space?: DrawingSpace;
    stackAbove?: string;
    style: DrawingStyle;
    text?: DrawingText;
    tool: string;
    viewportPoints?: ViewportPoint[];
    visible?: boolean;
    zIndex: number;
}

Properties

createdAt?: number

Epoch ms, set by the controller when the drawing is added.

id: string

The chart intervals the drawing is shown on. Absent means every interval. On an interval outside the range the drawing is kept and saved but not on the chart: it is not painted, hit-tested, boxed or erased there, and the object inventory marks it. visible stays the user's own switch.

locked?: boolean

Locked drawings render but cannot be selected or dragged on the chart. The user toggles it; a host restriction the user cannot lift is a DrawingPolicy.

paneIndex: number
points: DrawingPoint[]

Anchors in time and price. Empty on a viewport drawing, whose anchors are viewportPoints.

policy?: DrawingPolicy

Host restrictions on this drawing. Absent means none.

props?: Record<string, unknown>

Per-tool extras that do not belong on every drawing (a table's cells, a callout's tail side). Keeps the base shape closed while a tool stays free to carry what it needs. Must be JSON-safe: it is persisted verbatim.

space?: DrawingSpace

Which coordinates the anchors are in. Absent means 'data'. Only a tool that declares DrawingTool.viewport can be anchored to the viewport.

stackAbove?: string

Placed inside the series band, directly above one entry of its pane's chart.seriesStack(): 'source:primary' or 'indicator:<id>'. It paints after that entry's series and before the next entry's. While the entry plots no series on this drawing's pane (a study removed or moved away) it paints by zIndex as if absent, and returns when the entry does. Absent means the drawing is not in the series band. See DrawingController.placeInStack.

The label (or, for the text tool, the whole content).

tool: string

Registered tool id.

viewportPoints?: ViewportPoint[]

The anchors of a viewport drawing, one per handle. Present only when space is 'viewport'.

visible?: boolean

Default true.

zIndex: number

Paint order. Below zero paints under the series, at or above zero paints over it. Ties break by array order, so two drawings at 0 paint in the order they sit in the list. With stackAbove it orders the drawings placed above the same entry.