Visx: Stacked Areas

Created on 16 Feb 2018  ·  4Comments  ·  Source: airbnb/visx

Hi,

Maybe I'm missing something very simple but I'm not sure how to create a simple stacked area chart like this:
image

With https://vx-demo.now.sh/stacked-areas there's no white space
And with https://vx-demo.now.sh/streamgraph it goes negative (below horizontal axis)

I but it's a very simple things.
Thanks!

🔮question

All 4 comments

Hi @bernatfortet, here's an example of how to do this with <AreaStack />: https://codesandbox.io/s/k3vo8682q7

screen shot 2018-02-16 at 11 41 22 am

it's based on: https://bl.ocks.org/mbostock/3020685

main thing to know is

<AreaStack
  // ...
  y0={d => yScale(d[0])}
  y1={d => yScale(d[0] + d[1])}
  // ...
/>

Thank you so much! Very helpful 👍

I'm quite new to d3 and it has always felt very intimidating. yScale still feels very cryptic to me.
Do you know of any good intro to it?

I have some descent guides under scales here that might help -
https://github.com/techniq/wiki/wiki/d3

On Sat, Feb 17, 2018, 6:58 PM Bernat Fortet notifications@github.com
wrote:

Thank you so much! Very helpful 👍

I'm quite new to d3 and it has always felt very intimidating. yScale still
feels very cryptic to me.
Do you know of any good intro to it?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/hshoff/vx/issues/243#issuecomment-366480674, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAK1RIrYuCKb2IcaBhaApSkeYH1wACEEks5tV2eSgaJpZM4SH43o
.

🙏 Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danielprogramic picture danielprogramic  ·  3Comments

esetnik picture esetnik  ·  3Comments

hellosmithy picture hellosmithy  ·  3Comments

EfosaSO picture EfosaSO  ·  4Comments

techniq picture techniq  ·  3Comments