🌍 Public
Viewing a saved revision (read-only)
3b24004c7a7c41d68bf66ca1abdedbb0
Bar Graph shows Sales of Fruits in USD
This example shows a horizontal bar chart of fruit sales in USD, with bars extending from left to right to compare each fruit’s revenue. The code loads data from an external CSV file and multiplies the sales values by ten during preprocessing, then renders SVG rectangles using D3 v7’s `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom`. The visualization is drawn as SVG elements within a fixed 960×500 viewport, with axis labels for “Fruits” and “Sales in USD” added via text elements.
AI-generated description