Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Project ANalysis

Public visualization

Viewing a saved revision (read-only)

84abba95248d48daab42be04e4938ac9

Project ANalysis

0 stars1🌍 Public
PPreethi Medepalli-91
Last edited Dec 4, 2024
Created on Dec 4, 2024

This bar chart visualizes the average pollutant value for each country from a CSV dataset of world air quality. The chart uses D3.js v7 with an SVG rendering approach, employing `d3.scaleBand` for the categorical x-axis and `d3.scaleLinear` for the continuous y-axis. The data is aggregated using `d3.rollup` with `d3.mean` to compute country-level averages. Bars change color from steelblue to orange on mouseover, providing interactive feedback to the viewer.

AI-generated description

The code fetches data from a GitHub-hosted CSV file using PapaParse and visualizes the top 10 pollutants with the highest average values. The bar chart includes bars and displays pollutant names and average values, making it intuitive for users to interpret the data. Axes are clearly labeled, and the chart is styled for readability.