Skip to main content
100%

Bar Chart

✓ Published0🌍 Public
OOluoch Odhiambo
Last edited Apr 3, 2023
Created on Apr 3, 2023
Forked from D3 Starter

This bar chart visualizes a simple dataset of five values (10, 20, 30, 40, 50) using D3 v5. Rectangles are rendered as SVG elements, with their heights proportional to the data and their x-positions determined by a band scale (`d3.scaleBand`). A linear scale (`d3.scaleLinear`) maps the values to the vertical axis, and axes are generated with `d3.axisBottom` and `d3.axisLeft`. Bars change color on hover via CSS, and the chart includes a fixed 50-pixel left margin and 20-pixel top offset.

AI-generated description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes