🌍 Public
Viewing a saved revision (read-only)
3cf8175fe6dd46588994f7138052d0ab
Fork of Fork of Stacked bar chart of Yelp data: top cities
MMar-99
Last edited Mar 7, 2022
Created on Mar 7, 2022
This stacked bar chart visualizes the distribution of ten cuisine types across the top ten Yelp cities (excluding Boston), showing the number of four-star-or-above restaurants in each. Each horizontal bar represents a city, segmented by cuisine, with a legend mapping the color scheme. The chart uses d3’s `scaleBand` and `scaleLinear` for axes, `stack` to aggregate data, and `scaleOrdinal` for categorical colors. Tooltips reveal exact counts per segment, and the SVG is rendered with d3’s selection and append methods. Data comes from a CSV file loaded via `csv`.
AI-generated descriptionStacked bar chart of Yelp data: top cities
https://observablehq.com/@stefanreifenberg/basic-stacked-bar-chart-from-the-d3-js-gallery