Browse Components
Bubble
Compare two measures with a third encoded by area.
Basic
Hover, tap or focus a mark to inspect exact values. Arrow keys move between observations.
| Observation | Spend | Signups | Reach |
|---|---|---|---|
| Search | 25 | 42 | 180 |
| 12 | 35 | 95 | |
| Social | 38 | 27 | 240 |
| Partners | 20 | 52 | 120 |
| Events | 48 | 65 | 210 |
View Code
<figure class="chart" data-chart="bubble">
<figcaption>
Campaign performance
</figcaption>
<div class="chart-data">
<table>
<caption>
Campaign performance — example data
</caption>
<thead>
<tr>
<th scope="col">
Observation
</th>
<th scope="col">
Spend
</th>
<th scope="col">
Signups
</th>
<th scope="col">
Reach
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
Search
</th>
<td>
25
</td>
<td>
42
</td>
<td>
180
</td>
</tr>
<tr>
<th scope="row">
Email
</th>
<td>
12
</td>
<td>
35
</td>
<td>
95
</td>
</tr>
<tr>
<th scope="row">
Social
</th>
<td>
38
</td>
<td>
27
</td>
<td>
240
</td>
</tr>
<tr>
<th scope="row">
Partners
</th>
<td>
20
</td>
<td>
52
</td>
<td>
120
</td>
</tr>
<tr>
<th scope="row">
Events
</th>
<td>
48
</td>
<td>
65
</td>
<td>
210
</td>
</tr>
</tbody>
</table>
</div>
</figure>Right-to-left
Labels follow the reading direction. Numeric and radial axes keep their established orientation.
| Observation | Spend | Signups | Reach |
|---|---|---|---|
| Search | 25 | 42 | 180 |
| 12 | 35 | 95 | |
| Social | 38 | 27 | 240 |
| Partners | 20 | 52 | 120 |
| Events | 48 | 65 | 210 |
View Code
<figure class="chart" dir="rtl" data-chart="bubble">
<figcaption>
Campaign performance
</figcaption>
<div class="chart-data">
<table>
<caption>
Campaign performance — example data
</caption>
<thead>
<tr>
<th scope="col">
Observation
</th>
<th scope="col">
Spend
</th>
<th scope="col">
Signups
</th>
<th scope="col">
Reach
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
Search
</th>
<td>
25
</td>
<td>
42
</td>
<td>
180
</td>
</tr>
<tr>
<th scope="row">
Email
</th>
<td>
12
</td>
<td>
35
</td>
<td>
95
</td>
</tr>
<tr>
<th scope="row">
Social
</th>
<td>
38
</td>
<td>
27
</td>
<td>
240
</td>
</tr>
<tr>
<th scope="row">
Partners
</th>
<td>
20
</td>
<td>
52
</td>
<td>
120
</td>
</tr>
<tr>
<th scope="row">
Events
</th>
<td>
48
</td>
<td>
65
</td>
<td>
210
</td>
</tr>
</tbody>
</table>
</div>
</figure>Empty data
The chart keeps its reserved space without inventing observations.
| Observation | Spend | Signups | Reach |
|---|
View Code
<figure class="chart" data-chart="bubble">
<figcaption>
Campaign performance
</figcaption>
<div class="chart-data">
<table>
<caption>
Campaign performance — example data
</caption>
<thead>
<tr>
<th scope="col">
Observation
</th>
<th scope="col">
Spend
</th>
<th scope="col">
Signups
</th>
<th scope="col">
Reach
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</figure>Installation
Download these files into the matching paths in your project, or use Create to assemble a kit. Include each dependency once. Do not also load app.css.
<link rel="stylesheet" href="/library/assets/base.css">
<link rel="stylesheet" href="/library/assets/chart-core.css">
<link rel="stylesheet" href="/library/assets/chart-plots.css">
<link rel="stylesheet" href="/library/assets/bubble-chart.css">
<script defer src="/library/assets/chart-core.js"></script>
<script defer src="/library/assets/chart-plots.js"></script>
<script defer src="/library/assets/bubble-chart.js"></script>12,194 bytes CSS including base · 15,414 bytes runtime JavaScript
Usage
Data format
Three columns: X, Y, and nonnegative Size. Bubble area, not radius, is proportional to Size. Zero size has no bubble; its row remains in the data table. Numeric axes retain their direction in RTL.
Shared interactions
Hover, tap or focus a mark to inspect its exact value. Arrow keys, Home and End move between marks; Escape dismisses the tooltip. The source table remains available without JavaScript. Enhanced charts expose exact values through accessible marks and tooltips.
Lifecycle and themes
Load Chart Core, Chart Plots and this component module. Theme tokens supply colors in light and dark modes. Use layoutCharts.refresh(root) after changing the table and destroy(root) before unmounting. Wide charts scroll within their frame.
Building with AI? The AI Manifest has these notes and the full contract. See the AI Guide.