Bar Chart with D3.js
✓ Published0🌍 Public
This example displays a bar chart of five categorical values, including topics like data visualization and machine learning, using D3.js with SVG rendering. The code loads D3 v6 from a CDN and builds the visualization with `d3.scaleBand` for the x-axis, `d3.scaleLinear` for the y-axis, and `d3.axisBottom` and `d3.axisLeft` to render the axes. Steel-blue bars are appended via `selectAll` and `enter`, with dimensions derived from the scales. The dataset is hardcoded in the script, and the chart is placed inside a div with the ID "chart".
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