Skip to main content
100%

Pollution ratings in different parts of City

✓ Published0🌍 Public
VVinay Vemuri
Last edited Jul 22, 2023
Created on Jul 22, 2023
Forked from Hello VizHub

This stacked bar chart shows pollution rating distributions across six Texas cities, with each bar segmented into five pH-level categories from below 5.0 to above 8.5. The visualization uses d3.stack() to compute the stacked series, d3.scaleOrdinal with a categorical color palette for the rating bands, and d3.scaleBand for the city axis. Hover interactions on individual rectangles trigger a custom tooltip displaying the exact percentage for that rating category, while the legend identifies each segment’s color. Data is loaded from a CSV file using d3.csv, and the chart is rendered as SVG with margins, axes, and labels configured through D3 selection methods.

AI-generated description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes