Skip to main content
100%

Make a Bar Chart with SVG and CSS

✓ Published0🌍 Public
NNewSage-01
Last edited Dec 26, 2019
Created on Dec 22, 2019

This example shows a horizontal bar chart of country populations, with bars extending from left to right, using data from a CSV file. The visualization renders as an SVG graphic, where the bar lengths represent population values and the y-axis positions correspond to country names. The code imports D3 v5 functions like `scaleLinear`, `scaleBand`, and `csv` from the 'd3' module, and builds the chart by appending rectangle elements to the SVG. Population values are multiplied by 1000 in the data preprocessing step.

AI-generated description
MIT Licensed

Similar vizzes