我在D3.js中绘制了sankey图表,并且也在高图中尝试过,当源和目标中的数据相同时,该图表就不会绘制。如何克服此限制。
var graph = {
"links": [
{"source":"1","target":"1","value":"1.7"},
{"source":"1","target":"2","value":"1.5"},
{"source":"2","target":"3","value":"1.2"},
{"source":"3","target":"4","value":"0.3"}
] ,
"nodes": [
{"name":"Energy"},
{"name":"Industrial Processes"},
{"name":"Electricity and heat"},
{"name":"Electricity"}
] }
我尝试过高排行榜。当数据类似时,我发现了同样的问题
series: [{
keys: ['from', 'to', 'weight'],
data: [{
from: 'total',
to: 'Useful kinetic energy',
weight: 56,
outgoing: true
}, {
from: 'total',
to: 'total',
weight: 27,
outgoing: true
}, {
from: 'total',
to: 'Sound loss',
weight: 17,
outgoing: true
}]
请建议我如何解决此问题,即当源和目标中的数据相同时