Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Task8_Question2

Public visualization

Viewing a saved revision (read-only)

0305b7227a184cf48ea678bc909628e8

Task8_Question2

0 stars0🌍 Public
KKeerthi
Last edited Apr 11, 2024
Created on Apr 11, 2024
Forked from Hello VizHub

This stacked bar chart shows the percentage distribution of cuisine preferences across five cities: Cambridge, Somerville, Newton, Quincy, and Salem. It uses d3.stack() to compute the stacked series and d3.scaleBand with d3.scaleLinear for the y- and x-axes, respectively. The SVG rendering includes interactive tooltips on mouseover that display the exact percentage for each cuisine segment, using d3.select and event handlers. Color encoding relies on d3.schemeCategory10 via d3.scaleOrdinal, with a legend positioned to the right of the chart.

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.