> For the complete documentation index, see [llms.txt](https://docs.chartsql.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chartsql.com/charts/bubble.md).

# Bubble

<table data-card-size="large" data-view="cards"><thead><tr><th data-card-target data-type="content-ref"></th><th data-hidden></th><th data-hidden></th><th data-hidden></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><a href="/pages/6fmOVt7LuOMBCDqIiROp#auto-bubble">/pages/6fmOVt7LuOMBCDqIiROp#auto-bubble</a></td><td></td><td></td><td></td><td><a href="/files/OZzlgneB0nnwiss5P75w">/files/OZzlgneB0nnwiss5P75w</a></td></tr></tbody></table>

## Auto Bubble

A bubble chart is a scatter chart but with different sized data points. When 3 numeric columns exist a bubble chart will be automatically created.

```sql
-- @title: Auto Bubble
-- @subtitle: Auto generted bubble chart
SELECT 
  Profit,
  Amount,
  (CAST(Profit AS FLOAT) / Amount) * 500 as Margin
FROM Sales
WHERE Status = 'Won'
LIMIT 10;
```

<div data-full-width="true"><figure><img src="/files/OZzlgneB0nnwiss5P75w" alt=""><figcaption></figcaption></figure></div>

| PROFIT  | AMOUNT   | MARGIN           |
| ------- | -------- | ---------------- |
| 27064.0 | 84572.0  | 160.005675637327 |
| 45307.0 | 133253.0 | 170.003677215522 |
| 14746.0 | 73728.0  | 100.002712673611 |
| 21198.0 | 75705.0  | 140.003962750149 |
| 37394.0 | 196808.0 | 95.001219462623  |
| 15454.0 | 67191.0  | 115.000520903097 |
| 13263.0 | 78013.0  | 85.005063258688  |
| 11532.0 | 76878.0  | 75.00195114337   |
| 13092.0 | 72732.0  | 90.001649892757  |
