Skip to main content
100%

Health and Wealth of Nations - Bubble Chart

✓ Published0🌍 Public
CColinEberhardt
Last edited May 28, 2019
Created on Mar 25, 2017

A bubble chart displays the relationship between life expectancy and income for nations, using population for bubble size and region for color. The data comes from a JSON file loaded via `d3.json`, and the chart is rendered with d3fc’s cartesian chart, logarithmic x-scale, and linear y-scale. A point series with a linear size scale creates the bubbles, while a legend from `d3-legend` is positioned over the SVG plot.

AI-generated description

This d3fc example demonstrates how to render a bubble chart with data that shows the relationship between life expectancy and wealth, obtained via Gapminder. The chart is constructed from the following components:

  • The d3.json component is used to load the data from a JSON file.
  • A cartesian chart, with a logarithmic x scale and linear y scale, is used to render the plot area, axes and labels.
  • A point series is used to render the data, with the size of each point defined via another linear scale.
  • A legend (courtesy of the d3-legend project), absolutely positioned over the chart.
mit Licensed

Similar vizzes