Skip to main content
100%

Stacked Bar Chart

✓ Published0🌍 Public
JJdlv00
Last edited Oct 24, 2017
Created on Oct 24, 2017

This stacked bar chart visualizes the frequency of game-playing habits across different age groups, with each bar segment representing a specific frequency category. The data is loaded from a CSV file using d3-dsv, then processed with d3-array to compute totals and sorted in descending order. The chart uses d3-scale for positioning and color encoding, d3-shape to compute stacked positions, and d3-axis for the axes, with y-axis labels formatted using SI prefixes via d3-format. The visualization is rendered as SVG, displaying the full distribution of responses across all age cohorts.

AI-generated description

This stacked bar chart is constructed from a CSV file storing the populations of different states by age group. The chart employs conventional margins and a number of D3 features:

  • d3-dsv - load and parse data
  • d3-scale - x- and y-position, and color encoding
  • d3-format - SI prefix formatting (e.g., “10M” for 10,000,000)
  • d3-array - compute simple statistics (e.g., max)
  • d3-axis - display axes
  • d3-shape - computed stacked positions

forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/3886208'>Stacked Bar Chart</a>

forked from <a href='http://bl.ocks.org/anonymous/'>anonymous</a>'s block: <a href='http://bl.ocks.org/anonymous/614b5d5d6df20fb06867760f124636dd'>Stacked Bar Chart</a>

gpl-3.0 Licensed

Similar vizzes