diff --git a/src/chart/sankey/SankeySeries.ts b/src/chart/sankey/SankeySeries.ts index 64825cb1f6..a915ef6bdd 100644 --- a/src/chart/sankey/SankeySeries.ts +++ b/src/chart/sankey/SankeySeries.ts @@ -204,7 +204,8 @@ class SankeySeriesModel extends SeriesModel { } setNodePosition(dataIndex: number, localPosition: number[]) { - const dataItem = this.option.data[dataIndex]; + const nodes = this.option.data || this.option.nodes; + const dataItem = nodes[dataIndex]; dataItem.localX = localPosition[0]; dataItem.localY = localPosition[1]; } diff --git a/test/sankey-series-nodes.html b/test/sankey-series-nodes.html new file mode 100644 index 0000000000..7d40be3c11 --- /dev/null +++ b/test/sankey-series-nodes.html @@ -0,0 +1,79 @@ + + + + + + + + + + + + + +
+ + + \ No newline at end of file