Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Make a bar chart!

Public visualization

Viewing a saved revision (read-only)

1fd0bc9a372e46829ece2fbb09800113

Make a bar chart!

0 stars1🌍 Public
ZZihan (Lexie) Zhou
Last edited Mar 6, 2023
Created on Mar 6, 2023

This example shows a horizontal bar chart of population estimates for ten countries, sourced from the World Population Prospects 2017. The chart uses `d3.scaleLinear` for the x-axis and `d3.scaleBand` for the y-axis, with `d3.axisLeft` and `d3.axisBottom` to render ticks. Rectangles are appended to an SVG group after applying the margin convention. Data is loaded from a CSV file and converted to numeric values before rendering.

AI-generated description

Make a bar chart. Data from "World Population Prospects 2017" The topic includes representing a data table in JavaScript, creating rectangles for each row, using linear and band scales, the margin convention and adding axes.