Interactions & accessibility
Every live demo on this site is fully interactive — the points below apply to all of them.
Mouse
- Wheel — zoom both axes around the cursor.
- Drag the plot — pan left/right (time) and up/down (price).
- Drag the price axis — rescale price; drag the time axis — rescale bar spacing.
- Double-click — reset scale (fit content + autoscale).
- Hover a draggable order line — the cursor switches to
ns-resize, the line thickens and its pill brightens; the cancel×and DOM-ladder rows show apointercursor. Dragging shows a dimmed ghost at the pre-drag price (see On-chart trading).
Time navigator (hover-revealed zoom controls)
Move the pointer near the bottom of the chart and a small control strip fades in just above
the time axis — - + to zoom, ‹ › to step one bar at a time. It stays invisible
otherwise, so a clean chart stays clean.
The buttons run the same commands as the keyboard shortcuts, so the two can never drift
apart, and each tooltip shows the combo currently bound to that command — rebind zoomIn and
the tooltip follows.
createChart(el); // on by default
createChart(el, { timeNavigator: false }); // drop it entirely
createChart(el, { // or restyle
timeNavigator: { size: 30, revealHeight: 90, fadeSeconds: 0.2, showTooltip: false },
});| Option | Default | Description |
|---|---|---|
buttons | ['zoomOut','zoomIn',null,'panLeftBar','panRightBar'] | order; null inserts a group gap |
size / gap / groupGap | 26 / 4 / 16 | button box and spacing, px |
bottomMargin | 10 | gap above the time axis, px |
revealHeight | 64 | height of the band that reveals the controls, px |
fadeSeconds | 0.12 | fade duration; 0 disables the animation |
labels / hints | built-in | tooltip text and keyboard hint per action |
showTooltip | true | show the tooltip above the hovered button |
The controls live on the bottom pane and follow it when panes are added or removed. While hidden they hit-test to nothing, so they never steal a click from the chart underneath.
TimeNavigator is an ordinary primitive. To place your own — a second strip, a different
button set — import it, add it to a pane, and feed it pointer positions with setPointer.
Touch
Touch works out of the box (touch-action: none on the container):
- single-finger drag pans,
- two-finger pinch zooms,
- two-finger drag pans both axes.
Keyboard & accessibility
The container is focusable (role="application", tabindex=0, an aria-label you can
override) with a polite aria-live summary (bar count + latest price) that updates on data
changes. When focused:
| Key | Action |
|---|---|
| ← / → | pan time |
| ↑ / ↓ | pan price |
| + / − | zoom |
| Home / 0 | reset (chart.resetScale()) |
const chart = createChart(el, { ariaLabel: 'RELIANCE 5-minute candlestick chart' });Screenshots & grid
const canvas = chart.takeScreenshot(); // composites all panes + overlays → canvas
chart.downloadScreenshot('reliance-5m.png'); // same composite, downloaded as a PNG
chart.setGridOptions({ vertLines: false }); // toggle grid lines at runtimetakeScreenshot() composites every pane and overlay layer into a single image, so the
result matches exactly what the user sees — useful for share/export buttons.
downloadScreenshot(filename?) wraps it in a PNG download (also bound to the
screenshot keyboard shortcut).
The browser’s right-click “Save image as…” works too: the chart composites
the clicked pane into the layer the browser captures just before the native
menu opens (the chart renders as stacked canvases, so this used to save a
blank overlay). Note it saves the clicked pane only — for the full
multi-pane chart use takeScreenshot() / downloadScreenshot().