Skip to main content
100%

Dataviz 2018 - 3. Bar Chart - D3 CSV Data Import, Data Joins, Scales, Margin Convention, Axes - Ep7

✓ Published1🌍 Public

This example shows a horizontal bar chart of population estimates for ten countries, imported from a local CSV file. It demonstrates core D3 v7 techniques including `d3.csv()` for tabular data import, data joins via `selectAll().data().enter()`, and `scaleLinear` and `scaleBand` for positioning. The margin convention establishes an inner plotting area, and axes are added using `axisLeft` and `axisBottom`. The chart renders as SVG with steelblue rectangles, and population values are scaled by 1,000 during preprocessing.

AI-generated description

Making a Bar Chart:

Tabular data import using d3.csv() Data Joins Scales (Linear, Band) The Margin Convention Adding Axes

MIT Licensed

Similar vizzes