Skip to main content
100%

Learn Simple bar chart D3

✓ Published1🌍 Public
Aaruba-haroon
Last edited Mar 24, 2020
Created on Mar 24, 2020
Forked from Bar Chart

This example uses D3.js v4 to render a simple bar chart of nine arbitrary numeric values. The chart displays each value as a vertical rectangle, with heights proportional to the data, rendered as SVG elements via `d3.selectAll("rect").data().enter().append()`. Bars are positioned using the `transform` attribute and translated horizontally based on their index. The chart is styled with a teal background from the accompanying CSS file. The dataset is hardcoded in JavaScript rather than loaded from an external source.

AI-generated description

A program that shows the top 10 most populous countries as a bar chart.

Data: United Nations World Population Prospects 2019.

MIT Licensed

Similar vizzes