Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Food Production Stacked Bar Chart

Public visualization

Fork of Food Production Stacked Bar Chart

0 stars0🌍 Public
SSowjanya Devupalli
Last edited Oct 17, 2024
Created on Oct 17, 2024

This stacked bar chart displays the estimated 2021 food production across continents, with bars showing tonnage of various food categories. The visualization uses D3's `scaleOrdinal` with `schemeCategory10` for colors and `flatRollup` to reshape the CSV data from the Kaggle world food production dataset. The `stackedBarChart` function builds stacked rects using `stack()` and `scaleLinear` for x-values, while the adjacent `colorLegend` provides interactive highlighting, dimming non-hovered segments and drawing a stroke on the selected category.

AI-generated description

Stacked bars showing estimated food production breakdown of the continents. Based on an example from the tutorial

https://www.kaggle.com/datasets/rafsunahmad/world-food-production

https://raw.githubusercontent.com/lukesavoie/dataviz/main/world%20food%20production.csv loaded and parsed as CSV.

Comments

Sign in to join the discussion.

MIT Licensed