Tidy Stacked Area Chart | D3 | Observable
•ojs
•ojs
•ojs
•ojs
Comments (3)
Daniel Lucazeau
Aug 4, 2022
The stack calculation does not seem to work if any values are set to zero. I have tried with this cell: unemployment.forEach((d, idx) => { if (idx % 170 === 0) { d.unemployed = 0; } })
Fil
Aug 5, 2022
It's because it defaults to offset: d3.stackOffsetDiverging, which puts zeros on the x axis. You can use `offset: d3.stackOffsetNone` to fix.
Daniel Lucazeau
Aug 5, 2022
This fix it. Thanks
Reply
Add comment
Subscribe to notifications
Observable
Sign in
D3
Mike Bostock
15
Reply
Add comment
Subscribe to notifications
54
Tidy Stacked Area Chart | D3 | Observable