Assignment 2 Bar Chart
✓ Published0🌍 Public
This example shows a bar chart of student enrollment counts across twelve majors at UNT, with each bar’s height encoding the reported value. The chart is rendered as an SVG using D3 v7, with a linear y-scale for counts and a band x-scale for categorical major labels. Axes are added via `d3.axisLeft` and `d3.axisBottom`, with rotated x-axis tick text. The code uses `d3.scaleLinear`, `d3.scaleBand`, and D3’s selection and data-join methods to bind the hard-coded dataset to `rect` elements.
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