Skip to main content
Public

Share visualization

Loading preview…

Bar chart with D3.js

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 D3.js

2
GGogineni44
Last edited Apr 4, 2023
Created on Mar 19, 2023

This bar chart displays the distribution of car colors as percentages, using a dataset from a GitHub gist. Built with D3.js v5 in a React component, it renders as an SVG with animated bar interactions. The `d3.scaleBand` and `d3.scaleLinear` functions handle the axes, while `d3.axisBottom` and `d3.axisLeft` create the ticks. Hovering over a bar triggers a transition that highlights the bar and draws a red dashed line, showing the hovered value’s position, with divergence text displayed via `d3.selectAll` and `.transition()`.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed