Making a bar Chart
✓ Published1🌍 Public
This example shows a horizontal bar chart of country populations, ranking ten nations from China to Mexico using data loaded from a CSV file. The visualization uses D3 v5’s `scaleLinear` for the x-axis, `scaleBand` for the categorical y-axis, and `axisLeft` and `axisBottom` to render axes as SVG. Population values are read as strings and multiplied by 1000 before being mapped to bar widths. Bars are appended as `rect` elements within a translated group, styled with steelblue fills via external CSS.
AI-generated descriptionMIT Licensed