Learn D3.js
✓ Published0🌍 Public
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 descriptionA bare minimum HTML page.
See also React Starter.
MIT Licensed