Skip to main content
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.

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.
(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.
(key: K): void
(): void

Graph

(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.
(title: string, options?: { color?: Color | null; width?: LineWidth; style?: LineStyle }): GraphSeries<K>
A line through the values, in key order.
(title: string, options?: { color?: Color | null; size?: number }): GraphSeries<K>
A dot at each value, size 1 to 12 pixels (default 3).

GraphOptions

'percent'
'percent': values print with a % sign. Set the values in percent.
number
Decimal places for values.

Next step

Continue with Drawings.
Last modified on October 16, 2026