Skip to main content
100%

Assignment 2 Bar Chart

✓ Published0🌍 Public
Cchsaisriharsha@gmail.com
Last edited Jul 21, 2023
Created on Jul 21, 2023
Forked from Hello VizHub

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 description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes