Skip to main content
100%

D3 v4 Stacked Bar Chart with Negative Values - CFNAI Data

✓ Published0🌍 Public
TThanaporn-sk
Last edited Jul 2, 2019
Created on Jul 2, 2019

This stacked bar chart displays the Chicago Fed National Activity Index (CFNAI) from 1967 onward, breaking the index into four economic components that can be positive or negative. A black line overlays the bars to show the three-month moving average of the total index. Built with D3 v4, the visualization uses `d3.scaleTime` and `d3.scaleLinear` for axes, `d3.line` for the moving average, and custom logic to stack positive and negative values separately. Data comes from a local `cfnai.json` file, with an SVG-rendered legend and axis.

AI-generated description

##D3 v4 Stacked Bar Chart with Negative Values

A #d3js stacked bar chart that supports a mix of positive and negative values.

Data is from the Chicago Fed National Activity Index

The line represents the 3 month moving average of the compiled CFNAI components.

forked from <a href='http://bl.ocks.org/WillTurman/'>WillTurman</a>'s block: <a href='http://bl.ocks.org/WillTurman/9c4142944f6132855fd318350f552b7b'>D3 v4 Stacked Bar Chart with Negative Values - CFNAI Data</a>

forked from <a href='http://bl.ocks.org/hdervisevic/'>hdervisevic</a>'s block: <a href='http://bl.ocks.org/hdervisevic/1085b25d763cb92423dbc51ca4a76cc0'>D3 v4 Stacked Bar Chart with Negative Values - CFNAI Data</a>

mit Licensed

Similar vizzes