Skip to content

Drawing tools

Drawing state version (DRAWING_STATE_VERSION): 1.

Type Points Description
trendLine 2 Line segment between two time/price points
ray 2 Starts at the first point and extends through the second
extendedLine 2 Extends infinitely in both directions through its two points
horizontalLine 1 Horizontal price level spanning the entire pane
verticalLine 1 Vertical time marker spanning the entire pane
rectangle 2 Two-point shaded zone with 8 interactive corner and edge handles
parallelChannel 3 Two parallel trend lines; the third point sets channel width
fibRetracement 2 Retracement levels (0, 0.236, 0.382, 0.5, 0.618, 0.786, 1 by default)
text 1 Anchored multi-line text label
priceRange 2 Measures price change, percentage and bar count with 8 handles
Event Payload When it fires
created DrawingApi After a drawing is placed by tool or added via drawings.add()
changed DrawingApi After API edits or at the end of a pointer drag
removed DrawingApi When a drawing is removed by API, keyboard or clear()
selected DrawingApi | null When selection changes
hovered DrawingApi | null When pointer hover enters or leaves a drawing

See the Drawings guide for interactive examples, magnet snapping, autoscale and JSON persistence.