Skip to main content
Public

Share visualization

Loading preview…

Bar Chart with Highlighting

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Bar Chart with Highlighting

6
Ccbackes000
Last edited Nov 6, 2020
Created on Nov 3, 2020

This bar chart displays the populations of ten countries using horizontal bars, with color encoding highlighting ranges: red for those above one billion, orange for over 200 million, yellow for over 150 million, and green otherwise. The visualization is rendered as an SVG using d3.scaleLinear, d3.scaleBand, d3.axisLeft, and d3.axisBottom, with data loaded from a CSV via d3.csv. Hover interactions reveal a tooltip text element that displays country and population values, while adjusting bar opacity.

AI-generated description

This is my code after following a video tutorial by Curran Kelleher.

Comments

Sign in to join the discussion.

MIT Licensed