Skip to main content
100%

Making a Bar Chart

✓ Published0🌍 Public
HHimanshu Chelani
Last edited Apr 6, 2020
Created on Apr 6, 2020
Forked from HTML Starter

This example displays a horizontal bar chart of population figures for ten countries, with country names on the vertical axis and population values encoded as bar lengths on the horizontal axis. The chart is rendered as SVG using D3 v5. The code imports the data from a CSV file and uses D3's `scaleLinear` and `scaleBand` to map population and country names to coordinates, while `axisLeft` and `axisBottom` generate the chart’s axes. The bars are drawn as `rect` elements, and the population values are multiplied by 1,000 during data loading.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes