Skip to main content
100%

Activtiy6-Question2

✓ Published0🌍 Public
Aaashishvinayvasala@gmail.com
Last edited Apr 15, 2024
Created on Apr 15, 2024

This example visualizes the proportional sales distribution across five product categories (Clothing, Electronics, Books, Toys, Furniture, Jewelry) for five different time ranges, using a horizontal stacked bar chart. It imports data from a local `data.csv` file and renders the chart as an SVG with D3 v7, employing `d3.stack()` to aggregate the series and `d3.scaleOrdinal()` for color encoding. Interactive tooltips appear on mouseover, displaying the sales value for each segment, while a legend identifies the time ranges. The axes are labeled “Product Categories” and “Sales,” with the title “Sales by Category of Product” displayed above the plot.

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