🌍 Public
Viewing a saved revision (read-only)
6e666be9f89b49b986bf32878aead4ab
Making a Bar Chart
This bar chart displays the scores of four individuals—Simon, Mary, Jo, and Peter—on a fixed scale from 0 to 100. Each name is plotted as a blue rectangle using D3.js v7, with the chart rendered in SVG within a React-free HTML page. The code constructs an SVG canvas with specified dimensions and margins, then uses d3.scaleBand to position bars along the x-axis and d3.scaleLinear for the y-axis. Rectangles are appended and sized via data joins, with heights calculated from the score values.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.