Barplot
This example shows two bar charts side by side, both visualizing the same array of numbers. The first chart renders the bars using a standard JavaScript for loop, while the second uses D3’s data join with `selectAll`, `data`, and `enter` to create the rectangles. Both charts are drawn as SVG elements, with static positioning for x and y coordinates and bar heights proportional to the data values. The code relies on D3 v5 APIs such as `d3.select`, `append`, and attribute setters, and includes background coloring, axis lines, and titles for each chart.