Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Fork of Bar Chart

Public visualization

Fork of Fork of Bar Chart

0 stars1🌍 Public
Rrobertotienonyaranga@gmail.com
Last edited Mar 20, 2024
Created on Mar 20, 2024

This example pairs a bar chart of average crop yields by rainfall category with a scatter plot of individual rainfall-yield observations, using a small CSV dataset. The bar chart groups rainfall into bins (0–500, 500–1000, 1000–1500, 1500+ mm) and plots the mean yield per bin, while the scatter plot shows raw points with tomato-colored circles. Built with D3 v6, the code uses `d3.rollups` to aggregate means, `scaleBand` for categorical axes, and `scaleLinear` for continuous axes, rendering both charts as SVGs with hover highlighting on bars. The dataset is loaded via `d3.csv`, and the visualization focuses on revealing any correlation between rainfall and crop yield.

AI-generated description

States with Stamen employees as of January 2022

Comments

Sign in to join the discussion.

MIT Licensed