diff --git a/src/layout.js b/src/layout.js index f7687d9..79b918e 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 435be54..3d886e9 100644 --- a/src/wordCloud.js +++ b/src/wordCloud.js @@ -96,7 +96,8 @@ echarts.registerLayout(function (ecModel, api) { data.getName(idx), itemModel.get('textStyle.fontSize', 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