Correct usage of stack.values([accessor]) in D3 Streamgraph?

后端 未结 1 664
广开言路
广开言路 2021-01-16 11:11

I am trying to create a D3 streamgraph chart with additional data per layer using a values accessor, as demonstrated in the D3 API reference and this question at Stack Overf

相关标签:
1条回答
  • 2021-01-16 12:12

    The stack layout knows the values accessor you've specified, but the area generator does not. So, you have to pass d.values rather than d to the area generator, like so:

    .attr("d", function(d) { return area(d.values); })
    
    0 讨论(0)
提交回复
热议问题