javascript - 当我们有源数据并且在 highcharts 和 d3.js 中尝试匹配目标数据时,sankey 图表没有绘制
问题描述
我在 D3.js 中绘制了 sankey 图表并在 highcharts 中进行了尝试,当源和目标中的数据相同时,图表没有绘制。如何克服这个限制。
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
}]
请建议我如何克服这个问题,即当我们在源和目标中有相同的数据时
解决方案
推荐阅读
- pandas - 熊猫系列按特定时间分组
- r - 箭头数据集不支持过滤器表达式
- azure - Azure DevOps 管道 - 输出文件的自定义名称
- python-3.x - TypeError:无法腌制结构对象
- c - 在非结构/联合上使用函数指针
- mariadb - 我打算用 MHA 设置设置数据库服务器,我需要关于数据库结构的建议
- c# - .NET 5 源代码生成器。如何使用还引用的程序集
- javascript - 更改请求标头 SOCKET.IO(无需断开连接和重新连接)
- phpstorm - 如何对齐 PHP/JavaScript 代码块?
- android - 如何检查我的 Android 应用程序是否与 Google Fit 应用程序断开连接