Package for drawing non-series data like labels and lines.


Types

AbsolutePosition

type

Position defined in absolute chart coordinates (time and price values).

Fields

time
float

Time coordinate of the absolute position.

price
float

Price coordinate of the absolute position.

offset
float

Offset adjustment for the absolute position.

Methods

__init__
(time, price, offset) -> None

Initializes an absolute position with time and price coordinates.


Chart

type

Chart class for drawing and managing non-series visual elements on the chart.

Methods

draw
(obj) -> None

Adds or updates a drawing element on the chart.

erase
(obj) -> None

Removes a drawing element from the chart.

clean
() -> None

Removes all drawing elements from the chart.


Label[T]

type

Base class for text labels that can be positioned on the chart.

Aliases

LabelAbs = Label[AbsolutePosition]
LabelRel = Label[RelativePosition]

Fields

text
str

Text content displayed by the label.

position
T

Position of the label on the chart (absolute or relative).

font_size
int

Font size of the label text.

text_color
indie.Color

Color of the label text.

bg_color
indie.Color

Background color of the label.

callout_position
indie.drawings.callout_position

Position of the label relative to its specified coordinates.

Methods

__init__
(text, position, font_size, text_color, bg_color, callout_position) -> None

Initializes a new label with text, position and optional styling parameters.


LineSegment

type

Drawable line segment between two points with customizable style and endpoints.

Fields

point_a
indie.drawings.AbsolutePosition

Starting point of the line segment.

point_b
indie.drawings.AbsolutePosition

Ending point of the line segment.

a_end
indie.drawings.line_ending_style

Style of the line ending at point A.

b_end
indie.drawings.line_ending_style

Style of the line ending at point B.

extend_type
indie.drawings.extend_type

How the line should be extended beyond its endpoints.

color
indie.Color

Color of the line segment.

line_style
indie.drawings.line_segment_style

Visual style of the line (solid, dashed, dotted).

line_width
int

Width of the line segment in pixels.

Methods

__init__
(point_a, point_b, a_end, b_end, extend_type, color, line_style, line_width) -> None

Initializes a new line segment between two points with optional styling parameters.


RelativePosition

type

Position defined relative to chart boundaries using percentage ratios.

Fields

vertical_anchor
indie.drawings.vertical_anchor

Vertical anchor point (top, middle, bottom) for the relative position.

horizontal_anchor
indie.drawings.horizontal_anchor

Horizontal anchor point (left, center, right) for the relative position.

top_bottom_ratio
float

Vertical position ratio from 0.0 (top) to 1.0 (bottom) of the chart.

left_right_ratio
float

Horizontal position ratio from 0.0 (left) to 1.0 (right) of the chart.

Methods

__init__
(vertical_anchor, horizontal_anchor, top_bottom_ratio, left_right_ratio) -> None

Initializes a relative position with anchor points and ratio values.


Enums

callout_position

enum

Position of the label relative to its specified coordinates.

Static fields

TOP_RIGHT
indie.drawings.callout_position

Position of the label relative to its specified coordinates.

TOP_LEFT
indie.drawings.callout_position

Position of the label relative to its specified coordinates.

BOTTOM_RIGHT
indie.drawings.callout_position

Position of the label relative to its specified coordinates.

BOTTOM_LEFT
indie.drawings.callout_position

Position of the label relative to its specified coordinates.


extend_type

enum

Defines how line segments should be extended beyond their endpoints.

Static fields

NONE
indie.drawings.extend_type

Defines how line segments should be extended beyond their endpoints.

LEFT
indie.drawings.extend_type

Defines how line segments should be extended beyond their endpoints.

RIGHT
indie.drawings.extend_type

Defines how line segments should be extended beyond their endpoints.

BOTH
indie.drawings.extend_type

Defines how line segments should be extended beyond their endpoints.


horizontal_anchor

enum

Horizontal anchor point for relative positioning.

Static fields

LEFT
indie.drawings.horizontal_anchor

Horizontal anchor point for relative positioning.

CENTER
indie.drawings.horizontal_anchor

Horizontal anchor point for relative positioning.

RIGHT
indie.drawings.horizontal_anchor

Horizontal anchor point for relative positioning.


line_ending_style

enum

Style of line segment endpoints (arrows, circles, etc.).

Static fields

NONE
indie.drawings.line_ending_style

Style of line segment endpoints (arrows, circles, etc.).

ARROW
indie.drawings.line_ending_style

Style of line segment endpoints (arrows, circles, etc.).

TRIANGLE
indie.drawings.line_ending_style

Style of line segment endpoints (arrows, circles, etc.).

CIRCLE
indie.drawings.line_ending_style

Style of line segment endpoints (arrows, circles, etc.).

DIAMOND
indie.drawings.line_ending_style

Style of line segment endpoints (arrows, circles, etc.).


line_segment_style

enum

Visual style of line segments (solid, dashed, dotted).

Static fields

SOLID
indie.drawings.line_segment_style

Visual style of line segments (solid, dashed, dotted).

DOTTED
indie.drawings.line_segment_style

Visual style of line segments (solid, dashed, dotted).

DASHED
indie.drawings.line_segment_style

Visual style of line segments (solid, dashed, dotted).


relative_position

enum

Predefined relative positions on the chart for placing elements.

Static fields

TOP_LEFT
indie.drawings.RelativePosition

Predefined relative positions on the chart for placing elements.

TOP_CENTER
indie.drawings.RelativePosition

Predefined relative positions on the chart for placing elements.

TOP_RIGHT
indie.drawings.RelativePosition

Predefined relative positions on the chart for placing elements.

MIDDLE_LEFT
indie.drawings.RelativePosition

Predefined relative positions on the chart for placing elements.

MIDDLE_CENTER
indie.drawings.RelativePosition

Predefined relative positions on the chart for placing elements.

MIDDLE_RIGHT
indie.drawings.RelativePosition

Predefined relative positions on the chart for placing elements.

BOTTOM_LEFT
indie.drawings.RelativePosition

Predefined relative positions on the chart for placing elements.

BOTTOM_CENTER
indie.drawings.RelativePosition

Predefined relative positions on the chart for placing elements.

BOTTOM_RIGHT
indie.drawings.RelativePosition

Predefined relative positions on the chart for placing elements.


vertical_anchor

enum

Vertical anchor point for relative positioning.

Static fields

TOP
indie.drawings.vertical_anchor

Vertical anchor point for relative positioning.

MIDDLE
indie.drawings.vertical_anchor

Vertical anchor point for relative positioning.

BOTTOM
indie.drawings.vertical_anchor

Vertical anchor point for relative positioning.