Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Activity6_Q2

Public visualization

Viewing a saved revision (read-only)

364b2be6a68b40109e1e0227dce2598d

Activity6_Q2

0 stars0🌍 Public
119n81a0581sunny@gmail.com
Last edited Oct 22, 2024
Created on Oct 22, 2024
Forked from Hello VizHub

This stacked bar chart displays automobile sales across a 12-month period, segmented by vehicle type (e.g., Supperminicar, Mediumfamilycar, Smallfamiliycar, Sports). The x-axis lists years, and the y-axis shows total sales, with each bar partitioned by color-coded vehicle categories via a legend. Built with d3.v6 and SVG rendering, the code uses `d3.stack()` to aggregate sales, `d3.scaleBand()` for the x-axis, `d3.scaleLinear()` for the y-axis, and `d3.schemeSet2` for colors. It also includes hover tooltips showing exact sales values. The data originates from `historical_automobile_sales.csv`, which provides variables like price and recession indicators, though the chart focuses solely on sales counts. The visualization uses `d3.axisBottom` and `d3.axisLeft` for axes with rotated labels, and applies `d3.select` for DOM manipulation.

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.