Active Foundation

Search documentation

Search all pages, headings and text, in the current package or topic or in all documentation.

Interaction and states

Tooltips, legend, selection under your control, the context menu and export - and what a chart shows when it cannot draw the data.

@workspace/active-charts 6.0.0Status unknowncontent differs from the recorded release 6.0.0baseline ce081dc3

Selection, tooltip, legend and exportClient

Selected: nothing

Selection#

Turn selection on with selection. Controlled, you own selectedItems and update it from onSelectionChange; uncontrolled, seed it with defaultSelectedItems. An item is a logical identity ({seriesId, key} for an item of a series, a cell, a node or a link), never a position, so one selection can be given to several charts. onItemActivate fires on a click or on Enter.

Tooltip, legend and menu#

  • tooltip={{mode: 'shared'}} shows every series at the hovered x; 'single' one item; 'split' one box per series.

  • legend toggles series; a hidden series leaves the scales.

  • The context menu (right click, long press, Shift+F10) carries copy, the data table and export; add your own items with contextMenu={{items}}.

Export#

The imperative ChartHandle (ref) offers exportAsPng, exportAsSvg, exportAsCsv and exportAsPdf. Each waits until the chart is still and resolves with the file (blob, filename) when it was handed to the browser. See Export.

States#

Data a chart cannot drawClient

No rows

Empty gauge range

Chart unavailable: the data does not fit this chart

A flow with a loop

Chart unavailable: the data does not fit this chart

Input a chart cannot draw truthfully (no rows, an empty gauge range, a sankey cycle, an inverted axis domain) shows a translated unavailable state, with a development diagnostic to your sink. For unexpected errors, wrap charts in your own <ChartErrorBoundary>.

This page as Markdown