Lumen ChartsLumen Charts
Configure the chart

Widget configuration

Options you pass when creating the widget, symbols and intervals, and chart types, panes and scales.

Download Markdown

You pass options to the widget when you create it. The container, datafeed, symbol, interval and runtime file location decide what the chart shows first. Keep your app's credentials out of these options.

Common options

OptionWhat it doesTips
containerThe element, or its ID, to draw the chart inMake sure it exists before you create the widget
library_pathFolder that holds the runtime filesInclude the trailing slash
datafeedYour datafeed callbacksAlways call either the success or the error callback
symbolThe first symbol to showYour datafeed must be able to resolve it
intervalThe first resolution to showPick a resolution you support
autosizeFill the containerGive the parent a height
themelight or darkYou can switch later with changeTheme
localeUI languageSet it when you create the widget
timezoneTimezone used for displayDoesn't change the units of bar timestamps
enabled_features / disabled_featuresTurn features on or offUse names from the feature catalog
save_load_adapterSaving and loadingProvide all four methods for each capability you turn on

Defaults and updates

By default the runtime uses interval 1D, timezone Etc/UTC, locale en and a size of 800 × 500, with autosize and fullscreen turned off. To change things after the chart starts, call the public methods. Changing the original options object afterwards has no effect.

Use applyOverrides to change supported chart appearance properties. applyStudiesOverrides is accepted, but this release doesn't apply indicator defaults yet; set an indicator's properties after adding it instead. Some options can only be set at creation time. To change those, remove the widget and create a new one.

Symbols and intervals

A symbol is a name your datafeed knows how to look up. A resolution (or interval) sets how much time each bar covers. Keep the labels you show users separate from the actual values you pass to the chart.

Switch symbol or interval

widget.onChartReady(() => {
  widget.setSymbol('MSFT', '60', () => {
    console.log('Symbol and interval changed');
  });
});

In a multi-chart workspace, use that chart's own API to change just one chart. If you want charts to stay in sync, set up the workspace linking controls on purpose.

Writing resolutions

Minute resolutions are plain number strings such as 15 and 60. Daily, weekly and monthly resolutions add a suffix, for example 1D, 1W and 1M. Seconds and tick resolutions also need the matching feature, configuration and provider metadata. Only offer intervals your data provider can actually deliver.

Return supported_resolutions from both your configuration and symbol lookup. Check inputs before you request history. When the user switches symbol or interval, cancel or ignore any history and realtime work still running for the old one. That way a late reply for the old symbol can't end up on the new chart.

Chart types, panes and scales

To pick a chart style, pass one of the supported style IDs to the chart API. The runtime rejects any style that isn't in its supported list.

IDStyle
0Bars
1Candles
2Line
3Area
8Heikin Ashi
9Hollow candles
10Baseline
12High-low
13Columns
14Line with markers
15Step line
16HLC area

Set a style

widget.onChartReady(() => {
  widget.activeChart().setChartType(1);
});

The high-low style is controlled by a feature flag. To build a style picker, call supportedChartTypes() for the current widget. Don't list every value from the declaration enum, because some of them aren't supported.

Panes and price scales

An indicator can share the main pane or get a pane of its own. Pane and scale handles let you move, resize and adjust scales where supported. Each source ID and handle belongs to one chart, so keep them with that chart. After loading a layout, get them again.

Visible time ranges use the documented time units. Pass a timestamp where one is expected, not a screen coordinate. Avoid changing canvas geometry directly. The API reference lists every method you can use.

On this page