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

# Graphs

> Charts with an axis of their own, by name, number or time, in the Script graphs panel.

Charts with an axis of their own (numbers, names or times rather than the chart's bars), such as returns by RSI bucket, volume by hour of the day, or venues side by side. They show in a panel of the workspace, which the script's legend opens. Declared at the top level with their series; series are set by key from the chart's handlers, and roll back with the forming bar.

## graph()

A graph with an axis of its own, at most 8 per script, each with up to 8 series.

* `axis: 'category'`: keys are names (`'Asia'`, `'14:00'`), shown in the order first set.
* `axis: 'number'` (the default): keys are numbers, spaced by value (`30` for an RSI of 30).
* `axis: 'time'`: keys are times, spaced by time.

```ts theme={"theme":"github-dark"}
function graph(title: string, options: GraphOptions & { axis: 'category' }): Graph<string>;
function graph(title: string, options?: GraphOptions & { axis?: 'number' }): Graph<number>;
function graph(title: string, options: GraphOptions & { axis: 'time' }): Graph<Time>;
```

## GraphSeries

One series of a graph: a value per key on the graph's axis. Setting a key again replaces its
value; a series holds at most 1,000 keys.

<ResponseField name="set()" type="(key: K, value: number, color?: Color | null): void">
  The value at `key`, optionally in its own colour. `na` keeps the key with no value drawn.
</ResponseField>

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

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

## Graph

<ResponseField name="bars()" type="(title: string, options?: { color?: Color | null; base?: number }): GraphSeries<K>">
  Bars from `base` (default 0) to each value. Several bar series side by side group their bars per key.
</ResponseField>

<ResponseField name="line()" type="(title: string, options?: { color?: Color | null; width?: LineWidth; style?: LineStyle }): GraphSeries<K>">
  A line through the values, in key order.
</ResponseField>

<ResponseField name="points()" type="(title: string, options?: { color?: Color | null; size?: number }): GraphSeries<K>">
  A dot at each value, `size` 1 to 12 pixels (default 3).
</ResponseField>

## GraphOptions

<ResponseField name="format?" type="'percent'">
  `'percent'`: values print with a % sign. Set the values in percent.
</ResponseField>

<ResponseField name="precision?" type="number">
  Decimal places for values.
</ResponseField>

## Next step

Continue with [Drawings](/terminal/reference/drawings).


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