Skip to main content
100%

Let's make a Bar Chart!

✓ Published1🌍 Public
Eezzep66
Last edited Nov 5, 2019
Created on Nov 4, 2019

This horizontal bar chart displays the populations of ten countries, scaled by thousands, with a tooltip revealing precise values on hover. The visualization uses D3 v5's `scaleLinear` for the x-axis and `scaleBand` for the categorical y-axis, rendering via SVG. Population data originates from the UN World Population Prospects, loaded from a CSV file using `csv`. A custom tooltip div appears on mouseover, positioned at the cursor using `event.pageX` and `pageY`. The chart’s axes are generated with `axisBottom` and `axisLeft`, and bars are drawn as SVG `rect` elements.

AI-generated description
MIT Licensed

Similar vizzes