Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

test

Public visualization

Viewing a saved revision (read-only)

4c3d6decdb174a0abb416b2151446784

test

0 stars0🌍 Public
AAlbert Zarate
Last edited Aug 1, 2021
Created on Aug 1, 2021

This example displays a horizontal bar chart of the top 100 countries by happiness score, using the World Happiness 2021 dataset. The chart includes x- and y-axis tick labels but omits axis titles and a chart title, rendering as an SVG via React. The code constructs the visualization with d3.scaleBand for the categorical y-axis, d3.scaleLinear for the numeric x-axis, d3.max for scaling, and d3.csv to fetch and parse the data. Each country is drawn as a `<rect>` element positioned by the scales.

AI-generated description

A program that shows the top 10 most populous countries as a pathetic bar chart with no axes.

Data: United Nations World Population Prospects 2019.