Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bar chart with D3.js

Public visualization

Viewing a saved revision (read-only)

744ffecadb2240778c125ea2cf45be75

Bar chart with D3.js

0 stars0🌍 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