我的 Angular 应用程序中有以下图表选项用于 sankey 图表:
this.chartOptions = {
color: ["#922752", "#ff9822", "#4390e1", "#53bcbc"],
tooltip: {
backgroundColor: "#ffffff",
borderWidth: 1,
formatter: `<b>{b}</b><br/>{c} ${this.unit}`,
padding: 8,
textStyle: { color: "#212529" },
trigger: "item",
triggerOn: "mousemove",
},
series: [
{
type: "sankey",
left: 0,
top: 0,
bottom: 0,
nodeWidth: 10,
data: this.seriesData,
draggable: false,
label: {
fontWeight: "bold",
formatter: "{b}",
},
links: this.seriesLinks,
focusNodeAdjacency: "allEdges",
itemStyle: {
borderWidth: 0,
},
lineStyle: {
color: "source",
curveness: 0.5,
},
},
],
};
这是当前的结果:
但目标是在第一层每个节点应该有另一种颜色,它下面的层(深度+1)应该有父颜色,但只有-10%的颜色饱和度。
例子: