Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Bar Chart with Basic Hover

Public visualization

Viewing a saved revision (read-only)

9da313d8e20d42ec9895cfbafb8cd6c3

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