Making a Bar Chart for air quality data
✓ Published1🌍 Public
This example displays a horizontal bar chart of air quality index values for nine Indian cities, from Delhi with the highest reading down to Chandrapur. The visualization shows each city’s AirQuality value as a gray bar extending from the left axis. The code uses D3 v5’s `scaleLinear` for the x-axis, `scaleBand` for the y-axis categories, and `axisLeft` and `axisBottom` to render the tick marks. Data is loaded from a local CSV file via `d3.csv`, which is then scaled and drawn as SVG rectangles.
AI-generated descriptionMIT Licensed