Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bar Graph shows Sales of Fruits in USD

Public visualization

Viewing a saved revision (read-only)

09a59d4c4e9d44b9998a66a9ea8f25a2

Bar Graph shows Sales of Fruits in USD

0 stars0🌍 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