Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Making a Bar Chart

0 stars0🌍 Public
TTheRoadSign
Last edited Nov 25, 2019
Created on Nov 25, 2019

This example shows a simple bar chart of population data for eight countries, loaded from a CSV file. The chart renders as a single black square because the code only appends a rectangle for each data row and sets its width and height to 400 pixels, without scaling or positioning them. The implementation uses D3 v5’s `select` and `csv` functions to select the SVG element and parse the data, converting the population strings to numbers with `+d.population * 1000`.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed