Kumo Charts

Events

chart.on(event, listener) returns a function that stops listening:

Event Content When
ready { chart, instance, symbol, timeframe } The first chart is made and starts loading data; the content is as for chartReady, for the current chart
chartReady { chart, instance, symbol, timeframe } A chart of the layout is made (rebuilt too), with chart its position in the layout and instance its Chart; the place to add the page's own markers or lines to each chart
symbolChange { chart, symbol } The symbol the current chart shows changed: picked by the user, switched by a method, or another chart became the current one; chart is the current chart's position in the layout
watchlistStar { symbol, starred } The user clicked a star in the symbol search: starred is true to add the symbol to the watchlist and false to take it out; the page changes its own list and gives it to watchlist again, see "Watchlist"
timeframeChange { chart, timeframe } As above, for the timeframe
chartTypeChange { chart, chartType, settings } As above, for the chart type; also emitted when the settings of the current type change (the trades per tick bar, say). settings are the settings of the current type, null for a type without settings
indicatorsChange { chart, indicators } Indicators of a chart were added, removed, changed in their parameters or lines, shown or hidden; chart is its position in the layout
comparisonsChange { chart, comparisons } Compared symbols of a chart were added, removed, changed in placement or style, shown or hidden
drawingsChange { chart, symbol, drawings } The drawings of a chart on a symbol changed (drawings belong to charts)
alertsChange { symbol, alerts } Alerts of a symbol were added, changed, moved, paused or resumed, or removed
alertStatusChange { symbol, id, status } Whether the page is watching an alert changed: it started watching, the data is on its way, paused, expired, cannot be watched; see "Alerts"
alert See below An alert fired
layoutChange { grid, active, links } The multi-chart layout, the current chart or the links changed
crosshairMove { chart, symbol, time, price, paneId } The pointer moves over a chart; time, price and paneId are null when it leaves
visibleRangeChange { chart, symbol, range } The bars shown on a chart changed (dragging, zooming, loading); range is { from, to }, the times of the first and last bars
chartClick { chart, symbol, time, price, paneId } A click on the plot area of a chart
buttonClick { id, item } A click on one of the page's own buttons; with a menu, item is the menu item picked
drawingBarClick { id, chart, symbol, drawing } A click on one of the page's own buttons in the floating bar (drawingBarItems), with drawing the selected drawing (with its id)
drawingToolChange { active, magnet, continuous, hidden, favorites } The state of the drawing tools changed: a tool picked up or put down, the magnet, keep drawing, drawings hidden, the favorite tools
drawingSelectionChange { selected } The drawing selected on the current chart was replaced or unselected, or the selected one changed; its content is on "A drawing toolbar of your own"
drawingBoundsChange { chart, id, bounds } The selected drawing moved in the window; measured only while listened to
contextMenuClick { id, chart, symbol, time, price, order? } One of the page's own context menu items was picked
contextMenuClose { chart, symbol, time, price, order? } A context menu with items of the page closed, or gave way to another menu; the arguments are those given to contextMenu when it opened, to take away what was drawn while the menu was open, say
dataError { chart, symbol, request, interval, error } The datafeed failed: request is symbol (resolveSymbol), bars (getBars) or history (loading earlier bars to the left); error is the error the datafeed threw, to report to your own monitoring
storageError { operation, error } The storage failed: operation is load (it could not be read, and nothing is saved for as long as the chart stays open) or save (it was not saved, and the next change saves again); the default browser storage reports too when it is full or disabled

The content of alert: id (which alert), symbol, timeframe (the timeframe of the bars judged), time (the time of the bar when it fired), price (the close of that bar), subject (what was compared, with drawings written by type so that it reads even after the drawing is removed: { source, trigger, value }), message (the message the user wrote), replay (whether it fired while replaying history), remote (whether it was judged elsewhere and reported through reportAlert(), see "Alerts"), title and body (the alert's text, written in the chart's language, as "Alert" and "BTC/USDT Crossing up 68,000.00 · Watch the breakout", ready to use in push notifications).

Every time is a timestamp in milliseconds; price is the price on the main pane and the indicator's value on a pane below. All event names are in PRO_CHART_EVENTS. The events that report state, from symbolChange to alertsChange, are emitted once a round of changes ends, reporting only the outcome: when setState() changes the symbol, the layout and the indicators, say, each is reported once.

// The page's own quote bar follows the crosshair.
chart.on('crosshairMove', ({ time, price }) => {
  quoteBar.show(time === null ? null : { time, price });
});

// Report datafeed errors.
chart.on('dataError', ({ symbol, request, error }) => {
  monitor.capture(error, { symbol, request });
});

↑↓ to select · Enter to open · Esc to close