Making a Bar Chart
✓ Published0🌍 Public
This example visualizes the top 10 countries by total merchandise exports for 2017, using a horizontal bar chart where bar length encodes export value in trillions. The chart is rendered with D3 v5, using `d3.scaleLinear` for the value axis, `d3.scaleBand` for country categories, and `d3.axisLeft`/`d3.axisBottom` for ticks. Data is loaded from a CSV file using `d3.csv` and multiplied by 1000 to convert from scientific notation. The SVG output styles bars green via CSS.
AI-generated descriptionThis bar chart shows the Top 10 total merchandise export worldwise. The data comes from the year 2017 in World Trade Organization: Total Merchandise Export 2017.
MIT Licensed