Making a Bar chart
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.