Interaction

How interactive charts show values in tooltips, highlight series from the legend and let people show and hide series.

Interaction lets people explore the details without crowding the chart. These are common patterns that charting libraries such as ECharts and Chart.js support, not an exhaustive list. Use what the library provides before building something custom.

Don’t hide what matters behind interaction

Hover isn’t available on touch screens, and charts may be printed or exported. Keep the main message, important values and series names visible without interaction.

Show values in a tooltip

On hover or tap, show a tooltip with the name and value of each item, so people can read exact values without crowding the chart. On line charts, show one tooltip for all series at that point, so people can compare them. If a tooltip shows one series at a time, make that clear.

Hover over a month to see every series at that point.

Show totals in tooltips for stacked charts

If the library supports it or can be configured to, show the total in the tooltip together with the value of each series on stacked charts.

Hover over a month to see each part and the total.

Use the legend to highlight, show and hide series

When someone hovers over a legend item, fade the other series, so the chosen series stands out. Clicking a legend item can also show or hide its series. Make the hidden state clear in the legend.

Hover over a legend item to highlight its series. Click an item to hide or show it.