Skip to content
Drawings and Overlays

Update Drawing

Overwrites a saved drawing with new shape data. Call it after the user moves control points or changes the color or line width. The request body must contain the complete drawing, not only the changed fields. When control points change, update timestamp_min and timestamp_max as well. If the call fails, the server keeps the drawing as it was; ask the user to try again or reload the list.

PUThttps://api.lbkrs.com/v1/watchlist/draw_shapes/{id}

Parameters

idstringpathRequired

Drawing ID from id in GET /v1/watchlist/draw_shapes

Request body application/json

idinteger

Drawing ID, the same as id in the path

counter_idstringrequired

Security ID

kline_typeintegerrequired

K-line period the drawing belongs to; same values as line_type in GET /v3/quote/kline

timestamp_minintegerrequired

Earliest time the drawing covers as a Unix timestamp in seconds; the smallest control point time

timestamp_maxintegerrequired

Latest time the drawing covers as a Unix timestamp in seconds; the largest control point time

shape_dataobjectrequired

Drawing shape data. The chart component generates this object, and a read returns it to the chart component as-is to restore the drawing. Fields not listed here must also be saved and returned unchanged.

Child attributes
shape_typeinteger

Shape type defined by the chart component (such as line, ray, or channel)

control_pointsarray<object>

Control points of the shape, in drawing order

Child attributes
xstring

Time of the control point as a Unix timestamp in seconds, in string form

ystring

Price of the control point

total_control_pointsinteger

Total number of control points the shape needs

finishedboolean

Whether the shape is complete

color_strstring

Line color as a hex value, such as #37A0FF

line_widthinteger

Line width

line_styleinteger

Line style defined by the chart component

Responses

HTTP 200The request succeeded. A code of 0 means the drawing was updated.
codeintegerrequired

Business status code, 0 indicates success

messagestringrequired

Human-readable result or error message.

Whale Docs