Skip to main content

Chart Configuration

Create a chart with new Chart(options) and pass the options below.

container and datafeed are required.

ParameterDescriptionMandatory
containerThe HTML element that hosts the chart.Yes
datafeedThe market data source used by the chart.Yes
symbolThe initial symbol to display.No
intervalThe initial timeframe or interval.No
themeThe initial theme name or theme object.No
chartTypeThe initial chart style such as candlestick or line.No
localeThe language and formatting locale.No
timezoneThe timezone used for the chart display.No
autosizeMakes the chart follow the size of its container.No
widthSets an explicit chart width.No
heightSets an explicit chart height.No
disabled_featuresTurns off selected chart features.No
enabled_featuresTurns on selected chart features.No
enabled_resolutionLimits the available resolutions shown to the user.No
debugEnables extra debug behavior.No
layoutSelects the initial layout type.No
hideSidebarsHides the sidebars in the chart shell.No
externalSaveLoadAdapterConnects the chart to an external layout persistence system.No
persistExternalAdapterToLocalStorageControls whether external adapter state is cached locally.No
load_last_chartRestores the last saved chart when available.No
save_to_local_storageSaves chart state locally for automatic restore.No
visible_plots_setControls whether the chart shows OHLC, OHLCV, or close-only data.No

Example

const chart = new Chart({
container: document.getElementById("chart")!,
datafeed,
symbol: "AAPL",
interval: "1D",
theme: "dark",
autosize: true,
});