Bar Chart
✓ Published0🌍 Public
This example displays a horizontal bar chart of weapon exporter values by country for 2017. The React component uses D3’s `scaleBand` and `scaleLinear` to map country names and numeric values to pixel positions, rendering each bar as an SVG `rect`. Data is loaded asynchronously from a CSV file via `d3.csv` and parsed with unary plus. The chart is styled with CSS classes, and margins define the layout within the SVG canvas.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed