Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Olympic Data stacked Bar Graph

Public visualization

Fork of Olympic Data stacked Bar Graph

0 stars6🌍 Public
EElena Momtcheva
Last edited Apr 8, 2024
Created on Apr 8, 2024

This example shows Olympic medal counts for countries as a horizontal stacked bar chart, with Gold, Silver, and Bronze segments colored using a d3 ordinal scale. Hovering over a legend item highlights that medal type in the bars while fading others. The visualization uses d3.stack for data transformation, d3.scaleBand and d3.scaleLinear for axes, and custom mouseenter/mouseleave handlers to update a hovered state, re-rendering the chart with adjusted opacity and stroke.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed