作者:青岛淘宝摄影 | 来源:互联网 | 2023-01-29 22:23
Ineedtopositionmultiple(ultimately4,butIamstartingwithtwohere)d3graphsononewebpag
I need to position multiple (ultimately 4, but I am starting with two here) d3 graphs on one web page. Following this tutorial, I created two divs:
我需要在一个网页上定位多个(最终4个,但我从这里开始两个)d3图表。在本教程之后,我创建了两个div:
And then I appended the graphs to their respective divs like so:
然后我将图形附加到它们各自的div中,如下所示:
var svg = d3.select("#line-graph").append("svg")
AND
var svg = d3.select("#donut").append("svg")
Yet, they are still on top of each other on the page. What am I missing?
然而,它们仍然在页面上相互叠加。我错过了什么?
I know there are other people who have had this problem, but a lot of those questions are either unanswered, or the answer did not solve my problem. You can see what I am talking about here.
我知道还有其他人遇到过这个问题,但很多问题要么没有答案,要么答案没有解决我的问题。你可以在这里看到我在说什么。
Thanks in advance.
提前致谢。
1 个解决方案