Skip to main content
100%

Making a Bar Chart

✓ Published2🌍 Public
MMiguel Martinez
Last edited Jul 19, 2019
Created on Jul 18, 2019
Forked from Hello VizHub

This example demonstrates how to build a horizontal bar chart from CSV data, displaying population estimates for ten countries. The visualization uses D3.js v5 with SVG rendering, employing `d3.scaleLinear` for the population axis and `d3.scaleBand` for country categories. The code loads data via `d3.csv`, applies a left axis through `d3.axisLeft` and a bottom axis with `d3.axisBottom`. Rectangles are appended dynamically, with height determined by the bandwidth and fill color set via CSS.

AI-generated description

An example showing the capabilities of VizHub.

MIT Licensed

Similar vizzes