You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by de...@apache.org on 2018/09/21 08:30:10 UTC

[incubator-echarts] branch master updated: feat(sankey): format sankey node tooltip

This is an automated email from the ASF dual-hosted git repository.

deqingli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git


The following commit(s) were added to refs/heads/master by this push:
     new e695353  feat(sankey): format sankey node tooltip
     new 8f7e1fc  Merge branch 'master' of https://github.com/apache/incubator-echarts
e695353 is described below

commit e6953536f5df0332f6c64b6a3bca6bced8eeb9de
Author: deqingli <an...@gmail.com>
AuthorDate: Fri Sep 21 16:26:29 2018 +0800

    feat(sankey): format sankey node tooltip
---
 src/chart/sankey/SankeySeries.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/chart/sankey/SankeySeries.js b/src/chart/sankey/SankeySeries.js
index 50eb149..bb3b33e 100644
--- a/src/chart/sankey/SankeySeries.js
+++ b/src/chart/sankey/SankeySeries.js
@@ -85,7 +85,15 @@ var SankeySeries = SeriesModel.extend({
             }
             return encodeHTML(html);
         }
-
+        else if (dataType === 'node') {
+            var node = this.getGraph().getNodeByIndex(dataIndex);
+            var value = node.getLayout().value;
+            var name = this.getDataParams(dataIndex, dataType).data.name;
+            if (value) {
+                var html = name + ' : ' + value;
+            }
+            return encodeHTML(html);
+        }
         return SankeySeries.superCall(this, 'formatTooltip', dataIndex, multipleSeries);
     },
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org