Fork of 11
This visualization shows chocolate product sales across the USA and UK using a vertical hierarchical tree layout, with nodes representing sales representatives, products, and their associated sales values. Node size encodes sales figures, while color distinguishes product categories (Bars, Bites, Other). Built with D3.js v7, it uses the `d3.tree` layout, square link paths, and SVG rectangles for nodes. Interactive tooltips appear on hover, displaying product details or aggregated sales totals for organizational nodes, with smooth transitions applied to highlighting and tooltip visibility.
AI-generated descriptionChocolate Sales Data Visualization
This project visualizes chocolate product sales data in the USA and UK using a hierarchical tree structure. The visualization shows sales representatives, their products, and sales values.
Features
- Vertical tree layout showing the hierarchical relationship between regions, sales representatives, and products
- Node size represents the sales value for each product
- Color-coded nodes by product category (Bars, Bites, Other)
- Interactive tooltips showing detailed information on hover
- Clean, responsive design
Technologies Used
- D3.js v7 for data visualization
- Plain JavaScript, HTML, and CSS
- No additional dependencies
How to Use
- Clone this repository
- Open
index.htmlin your browser - Explore the visualization:
- Hover over nodes to see details
- Node size indicates sales value
- Colors represent different product categories
Data Structure
The visualization uses hierarchical data with the following structure: