Skip to main content
100%

Making a Bar chart

✓ Published0🌍 Public
Aaditya-ux27
Last edited Apr 13, 2023
Created on Apr 12, 2023
Forked from HTML Starter

This example shows a bar chart of four people’s scores using blue rectangles on an SVG canvas. The data is hard-coded as an array of objects with names and scores. The chart uses D3.js v7 to create band scales for the x-axis and linear scales for the y-axis, with a margin-defined layout. The code leverages D3’s `selectAll` and `join` operators to bind data to the rectangles, setting each bar’s position, height, and width based on the score values. The visualization is rendered as SVG without axes or labels, focusing only on the bar geometry.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes