Skip to main content
100%

Activtiy-6-q2.3

✓ Published0🌍 Public
Sswapnadabburi@my.unt.edu
Last edited Oct 24, 2024
Created on Oct 24, 2024

This example visualizes sales distribution across product categories, breaking down each category's total sales into five segments based on rating scores (from "less than 5" to "greater than 8.5"). The chart uses stacked horizontal bars, with each product category represented as a bar segmented by colored sections corresponding to rating ranges. The visualization is built using D3 v7, loading data from a local CSV file, and employs `d3.stack()` to compute stacked bar positions, `d3.scaleBand()` for categorical y-axis positioning, and `d3.axisLeft` and `d3.axisBottom` for axes. Interactive tooltips appear on hover, displaying the specific rating segment and its sales value.

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