Skip to main content
100%

Bar chart with D3.js

✓ Published2🌍 Public
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
MIT Licensed

Similar vizzes