Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Histogram with Bins Using D3

Public visualization

Histogram with Bins Using D3

0 stars0🌍 Public
OOlha
Last edited Apr 16, 2022
Created on Mar 8, 2022
Forked from Histogram with D3

This example shows the distribution of docked bikes across California stations in 2013, with a control to adjust the histogram’s bin count from 2 to 40 in steps of 3. The chart uses D3’s `d3.bin` (with `value`, `domain`, and `thresholds` based on `x.ticks(numBins)`) to compute bins from a CSV loaded via `d3.csv`, then renders bars as SVG `rect` elements on a linear scale. Animated transitions via D3’s `transition` API update the y-axis and bar heights when the bin number changes, while the x-axis remains fixed to the full data domain.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed