Skip to main content
100%

Bar Graph shows Sales of Fruits in USD

✓ Published0🌍 Public
RRadhakrishna246
Last edited Mar 27, 2022
Created on Mar 6, 2022

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
MIT Licensed

Similar vizzes