Skip to main content
100%

Bar chart with D3.js

✓ Published0🌍 Public
Eest85
Last edited May 30, 2020
Created on May 30, 2020

This interactive bar chart displays crime statistics across Costa Rican cantons, breaking down reported incidents by victim type and offense category. Built with D3.js v5, the visualization uses `d3.scaleBand` and `d3.scaleLinear` to position SVG rectangles, with data loaded from a CSV file via `d3.csv`. Hovering over a bar triggers `mouseenter` and `mouseleave` events that fade other bars, draw a dashed threshold line via `chart.append('line')`, and temporarily display percentage divergence labels for comparison.

AI-generated description
MIT Licensed

Similar vizzes