🌍 Public
Viewing a saved revision (read-only)
114b69304195461d95d8ddfa1a65abec
Creating a Rectangle Chart
This example demonstrates a horizontal bar chart from the `products.csv` dataset, ranking products by their numeric attribute values. The chart uses an SVG canvas with a linear scale for bar lengths and a band scale for categorical product names, rendered via D3 v6’s `scaleLinear`, `scaleBand`, and `axisLeft`/`axisTop` APIs. Bars are drawn directly as SVG rectangles, with steelblue fills and compact axis labels. The setup processes CSV data and maps product names to the vertical axis while attribute values determine bar heights, producing a straightforward comparison of product metrics.
AI-generated description