🌍 Public
Fork of Fork of Bar Chart
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 descriptionStates with Stamen employees as of January 2022
MIT Licensed
Comments
Sign in to join the discussion.