Skip to main content
100%

Learn D3.js

✓ Published0🌍 Public
Ii202081
Last edited Mar 31, 2020
Created on Mar 31, 2020

This example shows a simple bar chart built with D3.js v4, where each bar’s height corresponds to a value from a hardcoded JavaScript array of nine numbers. The chart is rendered as SVG inside an HTML page, with a title and a dedicated `<svg>` element. The code uses `d3.select` to set the SVG dimensions, `selectAll` with `data` and `enter` to create rectangles, and `attr` to position each bar via a `translate` transform based on its index. The bars are drawn from the bottom, using the SVG height minus the data value for the y-coordinate.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes