如何更新堆积面积图中的数据?

How to update the data in a stacked area chart?

我在 d3.js 中创建了一个堆积面积图,并希望在单击其中一个场景按钮时使用 CSV 中的数据更新该图表。

这是我创建的 bl.ocks.org 要点的 link:http://bl.ocks.org/saraquigley/094e38913b550cf5f27f

如何正确绑定数据并让图表更新并显示适当的场景。

谢谢! 萨拉

感谢您的评论,in code veritas. I was able to answer my own question by further cleaning up my code and dealing with a data filtering issue that I had caused. I've updated the gist, same link as above希望它能帮助遇到类似问题的任何人。

萨拉