Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Activity6_Question2

Public visualization

Viewing a saved revision (read-only)

d1a50816223347a1a0ab7f01bea7012f

Activity6_Question2

0 stars0🌍 Public
Ggreeshmareddy135@gmail.com
Last edited Apr 6, 2024
Created on Apr 4, 2024

This stacked bar chart displays the distribution of chocolate ratings across five brands, showing the proportion of ratings in five percentage-based categories from “below 5.0” to “above 8.5.” The code uses d3.stack() to generate the stacked series and d3.scaleOrdinal for color mapping, with d3.axisBottom and d3.axisLeft for axes. Interactive tooltips appear on mouseover, showing the exact percentage per rating category. The data comes from a local CSV file loaded with d3.csv, and the visualization is rendered as SVG with a linear x-scale for percentages and a band scale for categories.

AI-generated description