Highcharts 桑基自定义
Highcharts Sankey customization
我可以创建以下图表:
Highcharts.chart('container', {
title: {
text: 'Highcharts Sankey Diagram'
},
chart: {
styledMode: false
},
plotOptions: {
series: {
// general options for all series
},
sankey: {
curveFactor: 0,
lineWidth: 1
}
},
series: [{
//minLinkWidth: 1,
keys: ['from', 'to', 'weight'],
data: [
['Root', 'Brazil', 0.01],
['Root', 'Canada', 0.005],
['Root', 'Mexico', 0.01],
['Root', 'USA', 0.01],
['Brazil', 'Portugal', 0.01],
['Brazil', 'France', 0.01],
['Brazil', 'Spain', 0.01],
['Brazil', 'England', 0.01],
['Canada', 'Portugal', 0.01],
['Canada', 'France', 0.01],
['Canada', 'England', 0.01],
['Mexico', 'Portugal', 0.01],
['Mexico', 'France', 0.01],
['Mexico', 'Spain', 0.01],
['Mexico', 'England', 0.01],
['USA', 'Portugal', 0.01],
['USA', 'France', 0.01],
['USA', 'Spain', 0.01],
['USA', 'England', 0.01],
['Portugal', 'Angola', 0.01],
['Portugal', 'Senegal', 0.01],
['Portugal', 'Morocco', 0.01],
['Portugal', 'South Africa', 0.01],
['France', 'Angola', 0.01],
['France', 'Senegal', 0.01],
['France', 'Mali', 0.01],
['France', 'Morocco', 0.01],
['France', 'South Africa', 0.01],
['Spain', 'Senegal', 0.01],
['Spain', 'Morocco', 0.01],
['Spain', 'South Africa', 0.01],
['England', 'Angola', 0.01],
['England', 'Senegal', 0.01],
['England', 'Morocco', 0.01],
['England', 'South Africa', 0.01],
['South Africa', 'China', 0.01],
['South Africa', 'India', 0.01],
['South Africa', 'Japan', 0.01],
['Angola', 'China', 0.01],
['Angola', 'India', 0.01],
['Angola', 'Japan', 0.01],
['Senegal', 'China', 0.01],
['Senegal', 'India', 0.01],
['Senegal', 'Japan', 0.01],
['Mali', 'China', 0.01],
['Mali', 'India', 0.01],
['Mali', 'Japan', 0.01],
['Morocco', 'China', 0.01],
['Morocco', 'India', 0.01],
['Morocco', 'Japan', 0.01]
],
type: 'sankey',
nodeWidth: 100,
name: 'Sankey demo series'
}]
});
我需要的是所有带子的宽度都很小:大约 1.5 毫米并且与实际值无关。现在会发生什么,一旦我将所有值设置为相同的值,图表就会刷新具有新宽度的条带。
谢谢
恐怕在当前的 sankey 实现中无法设置固定的 link 宽度:https://www.highcharts.com/forum/viewtopic.php?f=9&t=47595&p=171541&hilit=sankey+link+sankey+link+width#p171541
我可以创建以下图表:
Highcharts.chart('container', {
title: {
text: 'Highcharts Sankey Diagram'
},
chart: {
styledMode: false
},
plotOptions: {
series: {
// general options for all series
},
sankey: {
curveFactor: 0,
lineWidth: 1
}
},
series: [{
//minLinkWidth: 1,
keys: ['from', 'to', 'weight'],
data: [
['Root', 'Brazil', 0.01],
['Root', 'Canada', 0.005],
['Root', 'Mexico', 0.01],
['Root', 'USA', 0.01],
['Brazil', 'Portugal', 0.01],
['Brazil', 'France', 0.01],
['Brazil', 'Spain', 0.01],
['Brazil', 'England', 0.01],
['Canada', 'Portugal', 0.01],
['Canada', 'France', 0.01],
['Canada', 'England', 0.01],
['Mexico', 'Portugal', 0.01],
['Mexico', 'France', 0.01],
['Mexico', 'Spain', 0.01],
['Mexico', 'England', 0.01],
['USA', 'Portugal', 0.01],
['USA', 'France', 0.01],
['USA', 'Spain', 0.01],
['USA', 'England', 0.01],
['Portugal', 'Angola', 0.01],
['Portugal', 'Senegal', 0.01],
['Portugal', 'Morocco', 0.01],
['Portugal', 'South Africa', 0.01],
['France', 'Angola', 0.01],
['France', 'Senegal', 0.01],
['France', 'Mali', 0.01],
['France', 'Morocco', 0.01],
['France', 'South Africa', 0.01],
['Spain', 'Senegal', 0.01],
['Spain', 'Morocco', 0.01],
['Spain', 'South Africa', 0.01],
['England', 'Angola', 0.01],
['England', 'Senegal', 0.01],
['England', 'Morocco', 0.01],
['England', 'South Africa', 0.01],
['South Africa', 'China', 0.01],
['South Africa', 'India', 0.01],
['South Africa', 'Japan', 0.01],
['Angola', 'China', 0.01],
['Angola', 'India', 0.01],
['Angola', 'Japan', 0.01],
['Senegal', 'China', 0.01],
['Senegal', 'India', 0.01],
['Senegal', 'Japan', 0.01],
['Mali', 'China', 0.01],
['Mali', 'India', 0.01],
['Mali', 'Japan', 0.01],
['Morocco', 'China', 0.01],
['Morocco', 'India', 0.01],
['Morocco', 'Japan', 0.01]
],
type: 'sankey',
nodeWidth: 100,
name: 'Sankey demo series'
}]
});
我需要的是所有带子的宽度都很小:大约 1.5 毫米并且与实际值无关。现在会发生什么,一旦我将所有值设置为相同的值,图表就会刷新具有新宽度的条带。
谢谢
恐怕在当前的 sankey 实现中无法设置固定的 link 宽度:https://www.highcharts.com/forum/viewtopic.php?f=9&t=47595&p=171541&hilit=sankey+link+sankey+link+width#p171541