提交 825035a9 编写于 作者: L lang

Tooltip position fix

上级 c9a7935a
......@@ -50,6 +50,7 @@ define(function (require) {
init: function (ecModel, api) {
var zr = api.getZr();
zr.on('mousemove', this._mouseMove, this);
zr.on('mouseout', this._hide, this);
......@@ -57,6 +58,7 @@ define(function (require) {
},
render: function (tooltipModel, ecModel, api) {
// Reset
this.group.removeAll();
this._axisPointers = {};
......@@ -67,7 +69,7 @@ define(function (require) {
this._api = api;
this._tooltipContent.hide();
this._tooltipContent.update();
// Prepare data for axis trigger
var seriesGroupByAxis = {};
......
......@@ -106,11 +106,12 @@ define(function (require) {
* @constructor
*/
function TooltipContent(container) {
this.el = document.createElement('div');
container.appendChild(this.el);
this._container = container;
this._show = false;
}
......@@ -118,6 +119,21 @@ define(function (require) {
constructor: TooltipContent,
/**
* Update when tooltip is rendered
*/
update: function () {
var container = this._container;
var stl = document.defaultView.getComputedStyle(container);
var domStyle = container.style;
if (domStyle.position !== 'absolute' && stl.position !== 'absolute') {
domStyle.position = 'relative';
}
// Hide the tooltip
// PENDING
this.hide();
},
show: function (tooltipModel) {
clearTimeout(this._hideTimeout);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册