Skip to main content

Bubble Chart

Illustrates the relationship between three variables. The position of each bubble on the grid represents its values for two variables, and the size of the bubble represents the value of the third variable. This provides a visual representation of the relationship between three variables simultaneously. For example, it can be used to analyze the relationship between population, GDP per capita, and life expectancy for different countries.

Chart:


Code:

  muze
.canvas()
.columns(["Weight_in_lbs"])
.rows(["Miles_per_Gallon"])
.detail(["Name"])
.layers([
{
mark: "point",
encoding: {
size: "Horsepower",
color: {
value: () => "#8DD3C7",
},
},
},
])