> ## 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.

# Outputs

> Draw plots, panes, shapes, markers, drawings and tables, recolour candles, and fire alerts.

Show what a script found. Plots are declared at the top and set in the chart's handlers; drawings and tables are objects a handler creates and changes.

## Plots

| Plot | What it draws |
| - | - |
| `plot.line` | A line, solid, dashed or dotted |
| `plot.histogram` | Bars from a base, 0 by default |
| `plot.area` | A line with its area filled |
| `plot.points` | Dots or crosses, with no line between them |
| `plot.candles` | Candles of the script's own |
| `plot.fill` | A shade between two plots or levels |
| `plot.level` | A horizontal line across the pane, such as 70 on an RSI |
| `plot.background` | A shade behind the whole height of the pane |
| `plot.barColor` | The chart's own candles, recoloured |

`set(value, color)` sets the current bar; a plot not set on a bar is `na` there, and a line breaks across it unless it says `join: true`. A colour left out, or `null`, follows the theme's study palette. Up to 64 plots.

```ts theme={"theme":"github-dark"}
const basis = plot.line('Basis', { width: 2 });
const upper = plot.line('Upper', { color: color.withAlpha(color.study(3), 0.6) });
const lower = plot.line('Lower', { color: color.withAlpha(color.study(3), 0.6) });
const band = plot.fill('Band', upper, lower, { color: color.withAlpha(color.study(3), 0.08) });
```

## Panes and scales

An overlay script (`indicator(name, { overlay: true })`) draws on the price pane; any other draws in a pane of its own. A plot can choose with `pane`: `'price'`, `'own'`, or a name, which gives the script another pane.

* `autoscale: false` draws a plot at its values without stretching the scale, for levels far from the price.
* `range: { min: 0, max: 100 }` fixes the scale, as an RSI's.
* `band: { top: 0.84, bottom: 0 }` draws the plot on a hidden scale in a slice of the pane, such as volume at its foot.
* `offset` shifts a plot by whole bars, -500 to 500: positive draws into the space past the newest bar, like Ichimoku's leading spans.

## Shapes and markers

`plot.shape` draws a shape, a label or a character on the bars where `set(condition)` is true, at a fixed `location`. `plot.markers` adds any number of markers to a bar, each with its own position, shape, text and colour:

```ts theme={"theme":"github-dark"}
const marks = plot.markers('Big orders');

chart.onClose(() => {
  if (buyUsd.value > 1_000_000) marks.add({ position: 'below', shape: 'circle', text: fmt.usd(buyUsd.value), color: color.up });
});
```

## Drawings

`draw.line`, `draw.box`, `draw.label`, `draw.polyline` and `draw.linefill` place objects at times or bar numbers and prices, up to 500 bars into the future. They are made in the chart's handlers, and a drawing made while the forming bar updates is rolled back with it. Each kind is capped, 50 by default and at most 500 (`maxLines` and the others in `indicator`'s options), with the oldest removed first.

A common pattern draws only on the newest bar, with the cap set to what one bar draws, so each bar's drawings replace the last's:

```ts theme={"theme":"github-dark"}
indicator('Range lines', { overlay: true, maxLines: 2 });

const chart = bars();
const high = ta.highest(50);
const low = ta.lowest(50);

chart.onBar(() => {
  const top = high.update(chart.high);
  const bottom = low.update(chart.low);
  if (!chart.isLast) return;
  draw.line({ from: { bar: chart.index - 50, price: top }, to: { bar: chart.index, price: top }, extend: 'right' });
  draw.line({ from: { bar: chart.index - 50, price: bottom }, to: { bar: chart.index, price: bottom }, extend: 'right' });
});
```

## Tables

`draw.table({ position, columns, rows })` puts a table in one of nine positions of the script's pane, clear of the legend and the price axis; it may be made at the top. `cell(column, row, text, options)` writes a cell, with colours, size, alignment and a tooltip; `merge` spans cells. Write the cells on the newest bar only (`chart.isLast`). Text is shown as text: no markup, links or images, at most 500 characters. Up to 9 tables.

## Text and colour

* `fmt.price(x)` writes a price to the market's precision; `fmt.usd(x)` writes `$1.2M`; `fmt.pct(0.0123)` writes `1.23%`; `fmt.num` and `fmt.compact` the rest.
* `color.up`, `color.down`, `color.neutral` and `color.panel` are the theme's, and `color.study(i)` its study palette, so a script follows the reader's theme. `color.withAlpha(c, a)`, `color.mix(a, b, t)` and `color.rgb` make others.

## Alerts

`alert(name, { message })` declares an alert at the top, which the reader arms on the chart; `fire(condition, message)` fires it from a handler. An alert fires at most once per bar, only on live data, and by default only when a bar closes; `onForming: true` also fires on the forming bar, which repaints. Alerts fire in the browser while the chart is open.

## Next step

Give a script settings with [inputs](/terminal/guides/inputs).


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