D3 Example
✓ Published0🌍 Public
CCurran Kelleher
Last edited Nov 20, 2015
Created on Nov 20, 2015
This example demonstrates how D3’s stack layout transforms raw data by computing baseline offsets. It shows a table of world religious populations, where each row’s `y0` and `y` values are added through cumulative summing. The code uses `d3.layout.stack()` with a custom `y` accessor and `values` function, then outputs the result as JSON in a `<pre>` element. The data comes from `religionWorldTotals.csv`, parsed via `d3.csv`, and the visualization renders the transformed structure as text for inspection.
AI-generated descriptionThis is a small code example that shows what d3.layout.stack does. It adds y and y0 properties to your data, where y0 is the cumulative sum of y values. This is example 11 from the screencast Splitting Charts.
MIT License
<!-- Start of SimpleHitCounter Code --> <div align="center"><a href="http://www.simplehitcounter.com" target="_blank"><img src="http://simplehitcounter.com/hit.php?uid=1979120&f=16777215&b=0" border="0" height="18" width="83" alt="web counter"></a></div> <!-- End of SimpleHitCounter Code -->