> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0xarchive.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Drawings

> Lines, boxes, labels, polylines, linefills and tables.

Objects placed at times and prices, capped per kind (see IndicatorOptions). Create them in handlers. Changes made while the forming bar updates are rolled back with it.

## draw

Drawings are made in the chart's handlers; a table may also be made at the top level.

<ResponseField name="line()" type="(options: LineOptions): Drawing<LineOptions>" />

<ResponseField name="box()" type="(options: BoxOptions): Drawing<BoxOptions>" />

<ResponseField name="label()" type="(options: LabelOptions): Drawing<LabelOptions>">
  Labels are text only; no markup, links or images.
</ResponseField>

<ResponseField name="polyline()" type="(options: PolylineOptions): Drawing<PolylineOptions>" />

<ResponseField name="linefill()" type="(a: Drawing<LineOptions>, b: Drawing<LineOptions>, options?: LinefillOptions): Drawing<LinefillOptions>">
  Shade between two lines of this script, as drawn (extensions included). The fill goes when
  either line is deleted.
</ResponseField>

<ResponseField name="table()" type="(options: TableOptions): Table">
  At most 9 tables.
</ResponseField>

## Point

A point by time, or by bar number on the chart. Up to 500 bars into the future.

```ts theme={"theme":"github-dark"}
type Point = { time: Time; price: number } | { bar: number; price: number };
```

## LineStyleOptions

<ResponseField name="color?" type="Color | null" />

<ResponseField name="width?" type="LineWidth" />

<ResponseField name="style?" type="LineStyle" />

<ResponseField name="extend?" type="'none' | 'left' | 'right' | 'both'" />

## Drawing

<ResponseField name="id" type="number">
  Stable while the drawing exists, including across updates of the forming bar.
</ResponseField>

<ResponseField name="update()" type="(options: Partial<O>): void" />

<ResponseField name="delete()" type="(): void" />

## LineOptions

<ResponseField name="from" type="Point" />

<ResponseField name="to" type="Point" />

## BoxOptions

<ResponseField name="from" type="Point" />

<ResponseField name="to" type="Point" />

<ResponseField name="border?" type="LineStyleOptions" />

<ResponseField name="fill?" type="Color | null" />

<ResponseField name="text?" type="string" />

<ResponseField name="textColor?" type="Color | null" />

## LabelStyle

How a label sits at its point. `up`, `down`, `left` and `right` are boxes with a pointer at the
point (an `up` label sits below it and points up); the corner styles put the box's corner on
the point; `center` centres the box on it; `none` is the text alone. A shape name draws that
shape at the point with the text above it.

```ts theme={"theme":"github-dark"}
type LabelStyle = 'up' | 'down' | 'left' | 'right' | 'upperLeft' | 'upperRight' | 'lowerLeft' | 'lowerRight' | 'center' | 'none' | ShapeName;
```

## LabelOptions

<ResponseField name="at" type="Point" />

<ResponseField name="text" type="string" />

<ResponseField name="style?" type="LabelStyle" />

<ResponseField name="color?" type="Color | null" />

<ResponseField name="textColor?" type="Color | null" />

<ResponseField name="size?" type="Size" />

<ResponseField name="tooltip?" type="string" />

## PolylineOptions

<ResponseField name="points" type="readonly Point[]" />

<ResponseField name="closed?" type="boolean" />

<ResponseField name="fill?" type="Color | null" />

## LinefillOptions

<ResponseField name="color?" type="Color | null" />

## TablePosition

```ts theme={"theme":"github-dark"}
type TablePosition = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
```

## TableOptions

<ResponseField name="position" type="TablePosition">
  Where the table sits in the script's pane, clear of the legend and the price axis.
</ResponseField>

<ResponseField name="columns" type="number" />

<ResponseField name="rows" type="number" />

<ResponseField name="background?" type="Color | null" />

<ResponseField name="border?" type="Color | null">
  The lines between cells, and their width in pixels (0 to 4, default 1).
</ResponseField>

<ResponseField name="borderWidth?" type="number" />

<ResponseField name="frame?" type="Color | null">
  The outline around the table, and its width in pixels (0 to 4, default 1).
</ResponseField>

<ResponseField name="frameWidth?" type="number" />

## TableCellOptions

<ResponseField name="color?" type="Color | null" />

<ResponseField name="background?" type="Color | null" />

<ResponseField name="size?" type="Size" />

<ResponseField name="align?" type="'left' | 'center' | 'right'" />

<ResponseField name="valign?" type="'top' | 'middle' | 'bottom'" />

<ResponseField name="width?" type="number">
  The cell's width as a percent of the pane's width, 0 to 100. 0, the default, fits the text.
</ResponseField>

<ResponseField name="height?" type="number">
  The cell's height as a percent of the pane's height, 0 to 100. 0, the default, fits the text.
</ResponseField>

<ResponseField name="tooltip?" type="string">
  Shown when the pointer rests on the cell. Text only, like the cell.
</ResponseField>

## Table

<ResponseField name="id" type="number" />

<ResponseField name="cell()" type="(column: number, row: number, text: string, options?: TableCellOptions): void">
  Text only; no markup, links or images.
</ResponseField>

<ResponseField name="merge()" type="(fromColumn: number, fromRow: number, toColumn: number, toRow: number): void">
  Join the cells from (`fromColumn`, `fromRow`) to (`toColumn`, `toRow`) into one, which shows
  the first cell's text and style. Merged areas may not overlap; a later merge that overlaps an
  earlier one replaces it.
</ResponseField>

<ResponseField name="clear()" type="(): void" />

<ResponseField name="delete()" type="(): void" />

## Next step

Continue with [Alerts](/terminal/reference/alerts).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.