You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by ov...@apache.org on 2018/06/13 10:03:58 UTC
[incubator-echarts] 02/05: feat(tooltip): use non-html tooltip when
document is not defined
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 <zw...@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
ovilia@apache.org.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org