diff --git a/src/chart/sankey/SankeySeries.js b/src/chart/sankey/SankeySeries.js index 9feaf3e601..05abf323ac 100644 --- a/src/chart/sankey/SankeySeries.js +++ b/src/chart/sankey/SankeySeries.js @@ -138,6 +138,17 @@ var SankeySeries = SeriesModel.extend({ } }, + // Override Series.getDataParams() + getDataParams: function (dataIndex, dataType) { + var params = SankeySeries.superCall(this, 'getDataParams', dataIndex, dataType); + if (params.value == null && dataType === 'node') { + var node = this.getGraph().getNodeByIndex(dataIndex); + var nodeValue = node.getLayout().value; + params.value = nodeValue; + } + return params; + }, + defaultOption: { zlevel: 0, z: 2, diff --git a/test/sankey-vertical.html b/test/sankey-vertical.html index f28731ff9a..6962a36bf1 100644 --- a/test/sankey-vertical.html +++ b/test/sankey-vertical.html @@ -173,7 +173,10 @@ color: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#d1e5f0', '#92c5de', '#4393c3', '#2166ac', '#053061'], tooltip: { trigger: 'item', - triggerOn: 'mousemove' + triggerOn: 'mousemove', + formatter: function (params) { + return params.name + ': ' + params.value; + } }, animation: false, series: [