Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

task 8 question 2.2

Public visualization

Viewing a saved revision (read-only)

863e420158c3430d9253b138a4a21ad5

task 8 question 2.2

0 stars1🌍 Public
Vvchittimadha@gmail.com
Last edited Apr 15, 2024
Created on Apr 15, 2024

A stacked horizontal bar chart shows the proportion of ratings (below 4, 4-5, 5-6, 6-7, 7-8, above 8) for six food categories, with each bar segmented by rating range. The visualization uses D3.js v7 with SVG rendering, employing d3.stack() to aggregate the data, d3.scaleBand() for the category axis, d3.scaleLinear() for the percentage axis, and d3.scaleOrdinal() for color encoding. Interactive tooltips display the exact percentage of each rating segment on hover, using event listeners and d3.format() to present values. The data is loaded from a CSV file containing pre-computed proportions.

AI-generated description

Food items proportion