Man SDV Activity6_Task2
This stacked bar chart displays sales performance across five product categories—Electronics, Clothing, Books, Furniture, and Toys—for four regions (North, South, East, West), with percentages derived from the CSV dataset. The visualization uses D3.js v7 to render an SVG, employing d3.stack() to compute stacked series, d3.scaleOrdinal for category colors, and d3.scaleBand with d3.scaleLinear for axes. Interactive tooltips show exact category percentages on mouseover, while hover effects change bar opacity, and a legend identifies each category.
AI-generated descriptionStacked Bar Chart with D3.js
This project demonstrates how to create a stacked bar chart
using D3.js. The dataset used is provided in data.csv. The
visualization is implemented in index.html using D3.js.
Styling for the visualization is done in styles.css.
Usage
- Clone or download the repository.
- Open
index.htmlin a web browser.
Dataset
The dataset (data.csv) contains sales performance data of
different product categories across various regions.
Libraries Used
- D3.js (Data-Driven Documents)