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

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

commit 883e024737c1151ae5d40c39506ec0525c161f40
Author: Ovilia <zwl.s...@gmail.com>
AuthorDate: Wed Jun 13 17:10:53 2018 +0800

    feat(tooltip): use non-html tooltip when document is not defined
---
 src/component/tooltip/TooltipModel.js | 5 ++++-
 src/component/tooltip/TooltipView.js  | 4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/component/tooltip/TooltipModel.js 
b/src/component/tooltip/TooltipModel.js
index 3161aaa..5fe862b 100644
--- a/src/component/tooltip/TooltipModel.js
+++ b/src/component/tooltip/TooltipModel.js
@@ -46,7 +46,10 @@ export default echarts.extendComponentModel({
 
         displayMode: 'single', // 'single' | 'multipleByCoordSys'
 
-        useHtml: true,
+        useHtml: 'auto', // 'auto', true, or false
+        // 'auto': use html by default, and use non-html if `document` is not 
defined
+        // true: use html for tooltip
+        // false: use canvas, svg, and etc. for tooltip
 
         // 位置 {Array} | {Function}
         // position: null
diff --git a/src/component/tooltip/TooltipView.js 
b/src/component/tooltip/TooltipView.js
index ebf737d..0427904 100644
--- a/src/component/tooltip/TooltipView.js
+++ b/src/component/tooltip/TooltipView.js
@@ -51,7 +51,9 @@ export default echarts.extendComponentView({
         var tooltip = ecModel.get('tooltip');
 
         this._isRich = false;
-        if (tooltip.length && tooltip[0].useHtml === false) {
+        if (tooltip.length && (tooltip[0].useHtml === false // force using 
non-html
+            || tooltip[0].useHtml === 'auto' && !document)) // auto using 
non-html when no `document`
+        {
             this._isRich = true;
         }
 

-- 
To stop receiving notification emails like this one, please contact
ovi...@apache.org.

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

Reply via email to