Docs

Reference

The things you reach for most, in one place. Every prop, type and export is in the full API reference on GitHub.

AstroneumChart props

PropTypeWhat it does
symbolSymbolInfoThe symbol to show. Required.
periodPeriodThe timeframe, e.g. { multiplier: 1, timespan: 'hour', text: '1H' }. Required.
datafeedDatafeedWhere bars come from. Required. Read when the chart mounts, so use a new key to change it.
theme'dark' | 'light'The theme. Follows the operating system if left out.
stylesDeepPartial<Styles>Style overrides, including the chart type: { candle: { type: 'line' } }. Applies live.
mainIndicators{ name, calcParams? }[]Indicators drawn on the price chart. EMA 7, 25 and 99 if left out. Follows changes.
subIndicatorsstring[]Indicators in their own panes (['VOL'] by default). Follows changes.
historyCacheboolean | { namespace?, maxBars? }Save loaded bars in the browser. Off by default.
periodsPeriod[]The timeframes offered in the period bar.
drawingBarVisiblebooleanShow the drawing tools on the left. true by default.
locale, timezonestringLanguage (18 built in) and IANA time zone.
pluginsChartPlugin[]Plugins mounted with the chart.
accessiblebooleanMake the chart focusable and announce the crosshair prices to screen readers.
priceScale'linear' | 'log' | 'percent'How the price axis is scaled.
watermarkstring | NodeWhat is drawn faintly behind the bars. The Astroneum logo if left out.
ariaLabelstringThe label a screen reader announces for the chart. Used with accessible.
barStyle'candle' | 'heikin_ashi'Converts history only. For a live Heikin-Ashi chart use createTransformedDatafeed.
style, classNameSizing and styling of the container. Give it a height.

The handle (ref)

MethodWhat it does
setSymbol / getSymbolChange or read the symbol
setPeriod / getPeriodChange or read the timeframe
setTheme / getThemeChange or read the theme
setStyles / getStylesChange or read styles
setLocale / setTimezoneLanguage and time zone (with matching getters)
serializeState / loadStateSave and restore the chart as JSON, drawings and indicators included
getDataListLength, getLastDataTimestampHow many bars are loaded, and the newest timestamp
onCrosshairMove, setCrosshairFollow or drive the crosshair, e.g. to link two charts. onCrosshairMove returns a function that stops listening.
lockAllDrawingsLock or unlock every drawing

Chart type values

Chart typeHow to get it
Candlestickstyles.candle.type: 'candle_solid'
Hollow candles'candle_up_stroke' (also 'candle_stroke', 'candle_down_stroke')
OHLC bars'ohlc'
Line'line'
Area'area'
Heikin-AshicreateTransformedDatafeed(feed, () => heikinAshi)
RenkocreateTransformedDatafeed(feed, h => bars => generateRenko(bars, brick))
Range barscreateTransformedDatafeed(feed, h => bars => generateRangeBars(bars, range))

Imports

ImportYou get
astroneumAstroneumChart, createStandardCryptoDatafeed, createTransformedDatafeed, heikinAshi, generateRenko, generateRangeBars, configureIndicatorWorkers, clearHistoryCache, registerIndicator, getSupportedIndicators, formatters and more
astroneum/style.cssThe stylesheet. Import it once.
astroneum/replayBarReplay
astroneum/multichartMultiChartLayout
astroneum/watchlist, portfolio, alerts, scriptWatchlistManager, PortfolioTracker, AlertManager, ScriptEngine
astroneum/datafeeds/crypto, polygon, webtransportThe datafeeds on their own