🌍 Public
Viewing a saved revision (read-only)
dc6effb0ade64be9aca299168c31004c
Task8_Question2
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 descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.