I am referencing this d3 example of Stacked Bar Chart and try to implement in jsfiddle1
我正在引用这个d3示例的堆叠条形图,并尝试在jsfiddle1中实现。
I want to add this example into jsfiddle
, I have added 5 external source alone with source csv file but i got no output.
我想把这个例子添加到jsfiddle中,我已经添加了5个外部源,单独使用源csv文件,但是我没有输出。
这是我jsfiddle2
Can anyone help on this what I need to add there.
有人能帮我补充一下吗?
1 个解决方案
#1
2
The problem is that you have to embed the csv data in a different way, since it can neither be included into the fiddle like a js/css, nor requested from within javascript, because of browser restrictions.
问题是,您必须以不同的方式嵌入csv数据,因为它既不能像js/css那样被包含在fiddle中,也不能在javascript内请求,因为浏览器的限制。
You can for example include it in the HTML part of the fiddle:
例如,你可以把它包含在小提琴的HTML部分:
<pre id="csvdata">
date,wounds,other,disease
5/1854,0,95,105
[...]
</pre>
I updated your fiddle, it is working now.
我更新了你的小提琴,它现在在工作。
#1
2
The problem is that you have to embed the csv data in a different way, since it can neither be included into the fiddle like a js/css, nor requested from within javascript, because of browser restrictions.
问题是,您必须以不同的方式嵌入csv数据,因为它既不能像js/css那样被包含在fiddle中,也不能在javascript内请求,因为浏览器的限制。
You can for example include it in the HTML part of the fiddle:
例如,你可以把它包含在小提琴的HTML部分:
<pre id="csvdata">
date,wounds,other,disease
5/1854,0,95,105
[...]
</pre>
I updated your fiddle, it is working now.
我更新了你的小提琴,它现在在工作。