Skip to main content
100%

Making a Barchart

✓ Published2🌍 Public
Ooabundes
Last edited Aug 13, 2020
Created on Aug 12, 2020

This example shows a horizontal bar chart comparing the populations of ten countries, from China to Mexico. The chart uses D3 v5 APIs including `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to load the data, map values to positions, and render axes. Bars are drawn as SVG `rect` elements with a steelblue fill, and population values are multiplied by 1000 in the data-loading step before the visualization is rendered. The layout applies margins and transforms the main group to position the chart within the SVG canvas.

AI-generated description
MIT Licensed

Similar vizzes