π Public
Massachussetts Top 10 Crime city with margin and axis
CCurran Kelleher
Last edited Sep 23, 2019
Created on Sep 23, 2019
This chart visualizes the top 10 Massachusetts cities with the highest crime rates using data from a CSV mapping city crime and population. A bar chart displays each city on the x-axis and its crime rate on the y-axis, with a linear scale correctly inverted to place larger values at the top. Built with React and D3 v5, the code uses `scaleLinear`, `scaleBand`, and `csv` to load and render data as SVG rectangles, alongside gridlines and axis ticks.
AI-generated descriptionA modified version showing how to correctly deal with the inverted Y scale for a vertical bar chart.
MIT Licensed
Comments
Sign in to join the discussion.