Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a bar chart

Public visualization

Viewing a saved revision (read-only)

371c82e3c8654fdf9f72d890178c2bdc

Making a bar chart

0 stars1🌍 Public
JJaKokosz
Last edited Mar 24, 2020
Created on Mar 24, 2020

This example shows a horizontal bar chart ranking ten countries by population, with countries on the y-axis and population values on the x-axis. The code uses D3 v5’s `csv` to load the data, `scaleLinear` and `scaleBand` for scaling, and `axisLeft` and `axisBottom` to render axes. Bars are drawn as SVG `rect` elements, with a steelblue fill, and the chart is fitted within margins inside an SVG canvas.

AI-generated description

A bare minimum HTML page.

See also React Starter.