Overview
In this topic we're going to talk about how to create a Bubble chart using Preset. A Bubble Chart is a multi-variable chart that plots circles (i.e., bubbles) of varying sizes on a graph, which convey data size. Bubble charts are useful for discovering patterns and correlations.
In this walkthrough, we will create a Bubble Chart based on publicly accessible data from the Covid-19 Coronavirus pandemic. Have a look at the Sample Data section on Connecting to Preset to download this data.
Goal
In the instructions below, we will create a Bubble Chart that displays confirmed cases, deaths, and recoveries outside of the U.S. over the last month.
Step One: Getting Started
To start, log on to Preset and then select a workspace.
Next, let's define your datasource and select a chart type
At the top of the screen, select New. Then, in the drop-down menu, select Chart.
After you do this, the Create a new chart screen appears.
Step Two: Select a Datasource and Visualization
In the Choose a datasource field, select a data source.
Please see Connecting to Preset to learn how to add a datasource to Preset. Be sure to check out the Sample Data section to add Covid-19 data.
Next, in the Choose a visualization type field, click the Table (default) icon.
The Select a visualization type panel appears.
Look for the Bubble Chart type—or use the Search feature to filter by the word “Bubble”—and then select.
After you've done this, go ahead and select the Create new chart button.
Step Three: Start Building your Chart
Now we're going to define the parameters of your new chart. To start, in the Datasource & Chart Type area, make sure that the Datasource and Visualization Type match what you just selected.
You can change either or both of these at any time!
For the Bubble Chart, the Time fields are used to select the time data we will use (Time Column) and the time period from which data will be included (Time Range).
- In this example, we will use the date_trunc option in the Time Column.
- For the Time Range, we will select Last month.
Here's what it looks like:
Next, let's have a look at the Query section.
In the Series and Entity fields, select country for both. A series is a grouping of entities, which are simply data points to be plotted on the chart.
In the X Axis field, select deaths and use the COUNT_DISTINCT aggregator — the configured selection will appear as COUNT_DISTINCT(confirmed).
Before selecting Save, remember to provide a label for the metric in order to add meaning to the chart's tooltip.
It looks like this:
Complete the same process for the Y Axis field using COUNT_DISTINCT(deaths).
For the Filters field, we will include all countries except the US. So, select country, use the not equal to operator, and select US.
The Bubble Size field is used to define a 3rd variable to convey the relative data point contribution in terms of bubble size. In this field, we will use COUNT_DISTINCT(recoveries) — the larger the bubble, the higher the number of recoveries.
Lastly, the Max Bubble Size field depends on your preferences — in this example we used 75.
When done, the Query panel looks as follows:
Next, let's create some labels for the two axes. Select the Customize tab and add labels for each axis as follows:
You can also change other axis settings here, such as the margin size, formatting, bounds, and log scales.
Okay, now let's visualize the Bubble Chart.
Step Four: Visualize the Chart
In the Content Panel, select Run Query.
Step Five: Customize the Chart
Preset enables users to customize the appearance of chart types. For Bubble Charts, you can change the color palette, add a legend, and use the Customize tab to add axis details as described above.
Here's a look at a Bubble Chart with a different color palette: