Skip to main content
100%

Making a Bar Chart

✓ Published1🌍 Public
Ddivyanshu7073
Last edited Jan 8, 2020
Created on Jan 8, 2020
Forked from Making a Bar Chart

This example shows a horizontal bar chart of population data for the ten most populous countries, with each bar’s length proportional to population and country labels on the y-axis. The code uses D3 v5 primitives including `select`, `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to render an SVG visualization. Population values from the CSV are read as strings, multiplied by 1000, and then mapped to bar widths via a linear scale, while country names are mapped to y-positions using a band scale. The resulting chart is rendered with a minimal React-free setup inside an SVG container.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes