Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bar Chart Example

Public visualization

Viewing a saved revision (read-only)

2010905c5e964ed784677dcecb0a4692

Bar Chart Example

0 stars0🌍 Public
Qquiqdome
Last edited Feb 24, 2021
Created on Feb 24, 2021
Forked from SVGs and CSS

This example displays a bar chart of country populations, with each bar’s width fixed at 300 and height at 400 pixels. The chart is rendered as SVG elements using D3 v6, drawing rectangles via `svg.selectAll('rect').data(data).enter().append('rect')`. Population values are loaded from a CSV file using `d3.csv` and converted to numbers by multiplying by 1000. The current code only appends the rectangles without encoding data into visual attributes, leaving the bars uniform rather than proportional to population.

AI-generated description