D3: Basic Barchart
✓ Published0🌍 Public
This example shows a basic bar chart of 20 numeric values rendered as SVG rectangles, with each bar labeled by its value in white text. The chart uses D3 v5 scales, including a `scaleBand` for the x-axis positioning and a `scaleLinear` for the y-axis height calculation. Data is bound via `selectAll("rect").data()`, with bars and text labels positioned using the scales. The code loads D3 from UNPKG and demonstrates simple SVG generation without axes or interactivity.
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