Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Bar Chart with Basic Hover

Public visualization

Fork of Bar Chart with Basic Hover

0 stars1🌍 Public
FFremont
Last edited May 2, 2024
Created on May 2, 2024

This example shows the top 10 most populous countries as a bar chart, highlighting the selected bar in black while graying out the others when hovered. It uses D3.js `scaleBand` and `scaleLinear` for positioning, with mouseenter and mouseleave events updating the chart’s state. The data comes from the UN population estimates, rendered in SVG with responsive axes and resizable dimensions.

AI-generated description

Challenge

  • Add this interaction to a bar chart or other visualization that you have created

Comments

Sign in to join the discussion.

MIT Licensed