Skip to main content
100%

Activity6_Question3

✓ Published0🌍 Public
UUday Vandanapu
Last edited Oct 22, 2024
Created on Oct 21, 2024

This example shows a stacked horizontal bar chart comparing the percentage of ratings (from below 4.0 to above 8.0) for six different vegetables, with each segment colored by rating category. It uses d3.stack to transform the CSV data into stacked series and d3.scaleOrdinal for color mapping. The visualization relies on d3.axisLeft and d3.axisBottom for axes, while custom mouseover events trigger opacity changes and a tooltip displaying the exact percentage for each segment. The chart renders as SVG with axes and labels styled via external CSS.

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