Making a Bar Chart
✓ Published0🌍 Public
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.
MIT Licensed