Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Total Sales by State and Gender

Public visualization

Total Sales by State and Gender

0 stars1🌍 Public
Mmacgregorm01@gmail.com
Last edited Nov 13, 2024
Created on Nov 13, 2024

This example displays a stacked bar chart illustrating total sales by state, segmented by gender, using data from the `@mjmacgregor/grouped_states_genders` package. The chart uses D3's `scaleOrdinal` for colors, `stack` and `flatRollup` for data aggregation, and `scaleLinear` and `scaleBand` for axes. Hovering over the legend highlights the corresponding gender segment in the bars, while non-hovered segments fade. A color legend with interactive hover states is implemented using the custom `colorLegend` function.

AI-generated description

Stacked bars showing estimated religion breakdown of the most populous 20 countries in 2010. Based on an example from the tutorial Splitting Charts. Interactions:

  • Hover over the legend to highlight religions.

Data is from The Global Religious Landscape by Pew Research, generated using this processing script.

Comments

Sign in to join the discussion.

MIT Licensed