logoSemaphor
Charts

Scatter / Bubble Chart

Learn how to create a bubble and scatter chart in Semaphor

Bubble and scatter charts are used to visualize the relationship between two numerical variables. The bubble chart is a scatter chart with a third dimension for size.

Scatter Chart

  • The first column (dimension) is the label.
  • The second column (measure) is the x-axis.
  • The third column (measure) is the y-axis.
Card SQL
SELECT
    sub_category, -- label
    AVG(sales) AS "Avg. Sales", -- x-axis
    AVG(profit) AS "Avg. Profit" -- y-axis
FROM
    sales_data
 {{ filters | where }} GROUP BY
    sub_category
Results
| Sub Category | Avg Sales | Avg Profit |
| ------------ | --------- | ---------- |
| Tables       | 443.93    | -253.54    |
| Art          | 99.22     | 10.07      |
| Bookcases    | 173.07    | -289.74    |
| Storage      | 123.35    | -12.91     |
| Envelopes    | 30.65     | 10.74      |
| Fasteners    | 16.87     | 0.35       |
| Appliances   | 129.07    | 13.88      |
| Accessories  | 154.37    | 10.22      |
| Paper        | 78.73     | 27.16      |
| Phones       | 321.25    | 35.59      |

Chart

Bubble Chart

  • The first column (dimension) is the label.
  • The second column (measure) is the x-axis.
  • The third column (measure) is the y-axis.
  • The fourth column (measure) is the size of the bubble.
Card SQL
SELECT
    sub_category, -- label
    AVG(sales) AS "Avg Sales", -- x-axis
    AVG(quantity) AS "Avg Quantity", -- y-axis
    AVG(score) AS "# Product Score" -- size of the bubble
FROM
    sales_data
 {{ filters | where }} GROUP BY
   sub_category
Results
| Sub Category | Avg Sales | Avg Quantity | Product Score |
| ------------ | --------- | ------------ | ------------- |
| Tables       | 648.79    | 3.89         | 29.60         |
| Art          | 34.07     | 3.77         | 22.58         |
| Storage      | 264.59    | 3.73         | 22.75         |
| Bookcases    | 503.86    | 3.81         | 27.18         |
| Envelopes    | 64.87     | 3.57         | 29.30         |
| Fasteners    | 13.94     | 4.21         | 24.32         |
| Appliances   | 230.76    | 3.71         | 23.72         |
| Accessories  | 215.97    | 3.84         | 21.88         |
| Paper        | 57.28     | 3.78         | 28.72         |
| Phones       | 371.21    | 3.70         | 25.91         |

Chart

Grouped Bubble Chart

  • The first column (dimension) is the label
  • The second column (dimension) is the group (Legend)
  • The second column (measure) is the x-axis.
  • The third column (measure) is the y-axis.
  • The fourth column (measure) is the size of the bubble.
Card SQL
SELECT
    category, -- label
    region, -- group (Legend)
    AVG(sales) AS "Avg Sales", -- x-axis
    AVG(profit) AS "Avg Profit", -- y-axis
    score -- size of the bubble
FROM
    sales_data
 {{ filters | where }} GROUP BY
   category,
   region
Results
| Category        | Region  | Avg Sales | Avg Profit | Score |
| --------------- | ------- | --------- | ---------- | ----- |
| Technology      | West    | 420.69    | 73.96      | 17.68 |
| Technology      | South   | 507.75    | 68.23      | 14.60 |
| Office Supplies | South   | 126.28    | 20.09      | 17.40 |
| Office Supplies | West    | 116.42    | 27.73      | 18.65 |
| Furniture       | Central | 340.53    | -5.97      | 17.51 |
| Office Supplies | East    | 120.04    | 23.96      | 10.97 |
| Furniture       | East    | 346.57    | 5.07       | 11.43 |
| Office Supplies | Central | 117.46    | 6.24       | 18.01 |
| Furniture       | South   | 353.31    | 20.40      | 13.18 |
| Technology      | East    | 495.28    | 88.71      | 18.53 |

Chart

Notice that the label column (Category) appears in the tooltip.

On this page