Question 2
✓ Published0🌍 Public
A stacked bar chart depicts the survival rates for Titanic passengers, segmented by gender and categorized into "Survived" and "Not Survived." The chart uses horizontally stacked bars, with gender on the y-axis and percentage on the x-axis, and includes an interactive tooltip that displays the exact percentage on hover, while also highlighting the bar segment. The visualization is built with D3 v7, utilizing `d3.select`, `d3.scaleBand`, `d3.scaleLinear`, and the `d3.stack` function to manage the data aggregation and layout.
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