Skip to main content
100%

Making a bar chart

✓ Published0🌍 Public
EE.D.M.
Last edited Nov 4, 2019
Created on Oct 31, 2019

This example demonstrates how to build a simple bar chart from a CSV file using D3 v5. The chart displays population data for several countries, with horizontal bars whose widths are proportional to each country’s population. The code uses `d3.csv`, `scaleLinear`, and `scaleBand` to map the data to SVG rectangles, while the rendering is done entirely with SVG elements in an HTML page. The data is loaded from `data.csv` and scaled by a factor of 1000 before being visualized.

AI-generated description

An example showing the capabilities of VizHub.

MIT Licensed

Similar vizzes