From 21caf74e4271dc9ff752ccd239bbfd263f27e099 Mon Sep 17 00:00:00 2001 From: Yi Date: Fri, 14 Sep 2018 17:53:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9F=90=E6=96=87=E5=AD=97?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E8=A7=92=E5=BA=A6,=20=E9=80=82=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E4=B8=BB=E9=A2=98=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout.js | 2 +- src/wordCloud.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/layout.js b/src/layout.js index 079c229..32ce2f5 100644 --- a/src/layout.js +++ b/src/layout.js @@ -867,7 +867,7 @@ if (!window.clearImmediate) { var rotateDeg = getRotateDeg(); // get info needed to put the text onto the canvas - var info = getTextInfo(word, weight, rotateDeg); + var info = typeof(item[3]) == 'number' ? item[3] : getTextInfo(word, weight, rotateDeg); // not getting the info means we shouldn't be drawing this one. if (!info) { diff --git a/src/wordCloud.js b/src/wordCloud.js index 43707f2..4329c30 100644 --- a/src/wordCloud.js +++ b/src/wordCloud.js @@ -97,7 +97,8 @@ echarts.registerLayout(function (ecModel, api) { data.getName(idx), itemModel.get('textStyle.normal.textSize', true) || echarts.number.linearMap(value, valueExtent, sizeRange), - idx + idx, + typeof(itemModel.get('textStyle.rotation')) != 'undefined' ? itemModel.get('textStyle.rotation') : false ]; }).sort(function (a, b) { // Sort from large to small in case there is no more room for more words