Add Interaction - bar chart of crime in India
✓ Published0🌍 Public
LlzlazmSylas
Last edited Oct 7, 2021
Created on Oct 4, 2021
Forked from Iterate my work - bar chart of crime in India
This interactive bar chart visualizes rape crime cases across Indian states for a selected year from 2001 to 2014. A dropdown menu filters the data by year, and bars are sorted in descending order by case count. Hovering over a bar triggers a transition that adjusts opacity and displays the state name in a tooltip. The visualization uses d3.csv to load the dataset, d3.scaleLinear and d3.scaleBand for scaling, and d3.axisLeft and d3.axisBottom for axes, with SVG rendering and D3 transitions for the hover effect.
AI-generated descriptionDataset: https://gist.github.com/lzlazmSylas/6be318f1ef48498d10f831bbd78782f3#file-crimes_against_women-csv
X-axis: Number of cases
Y-axis: State
New things:
- Fix bug by filtering the "Year" column and set it to specified year. Now there is no bar staked together.
- Sort the data in descending order.
- Added hover effect to each bar in this visualization.
MIT Licensed