Skip to main content
100%

Activity_6_Q2

✓ Published0🌍 Public
Mmudunurirahulvarma98@gmail.com
Last edited Apr 4, 2024
Created on Apr 4, 2024
Forked from Hello VizHub

This example visualizes sales distribution across product categories using a stacked horizontal bar chart. Each bar represents a category from a CSV file, segmented by price ranges (less than 100 to above 400) as percentages. The code uses d3.stack() to compute stacked series, d3.scaleBand for the y-axis categories, and d3.scaleLinear for the x-axis percentages, rendered as SVG rectangles. Interactive tooltips appear on mouseover, displaying the exact percentage for each segment. The visualization employs d3.axisBottom, d3.axisLeft, and d3.scaleOrdinal with a custom color palette.

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