Skip to content
IndexRequest a UIAboutContact

Bubble Scatter with Labels

A bubble chart with position for two values and bubble area for a third; hover or focus shows details.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Clean bubble chart of nine countries with GDP per person on the horizontal axis and life expectancy on the vertical axis, translucent blue circles whose area shows population, the largest two labelled directly, one bubble highlighted with a thin dark outline and a small label card, light grey grid lines and axis titles, a size legend with three sample circles, flat vector style, calm and readable. Negative: 3D, gradients, rainbow colours, text errors, clutter. Reduced motion: static chart.

About this pattern

Definition

A bubble chart adds a third number to a scatter plot by changing the size of each dot. Size must follow area, not radius, or big values look far too large. Labels appear on hover and focus, and the biggest bubbles can be labelled directly so the chart can be read without interaction.

Purpose & UX principles

  • Map the third value to area: radius equals the square root of the value times a constant.
  • Draw big bubbles first so small ones stay visible on top, and use some transparency.
  • Label axes with units and add light grid lines.
  • Make each bubble focusable with an aria-label that reads all three values.

Interaction states

  • Two datasets; hover, focus or tap bubbles.

Motion specification

  • Bubbles grow into place over 400ms when data changes.
  • Reduced motion: no growth.

Responsive behaviour

  • Overlapping bubbles hide data; use transparency and consider jitter or filters.
  • Provide a table or text summary of the values.

Code

HTML
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Data"><button data-p="0" aria-pressed="true">Countries</button><button data-p="1" aria-pressed="false">Products</button></div><svg class="ch" id="ch" viewBox="0 0 330 160" role="group" aria-label="Bubble chart"></svg><p class="out" id="out" role="status">Hover or focus a bubble.</p></div>

Related patterns

Line Chart with Crosshair

↗
Line Chart with CrosshairData Visualization

Treemap Proportional Blocks

↗
Treemap Proportional BlocksData Visualization

Interactive Bar Chart

↗
Interactive Bar ChartData Visualization