diff --git a/doc/doc.html b/doc/doc.html
index 52066e8eb17710e414c502576eac6b6a00dce7e5..df79e1ef0c2ec914fce07c20999dd17b268b0310 100644
--- a/doc/doc.html
+++ b/doc/doc.html
@@ -723,7 +723,7 @@ require(['echarts'], function (ec){
{self} on |
{string} eventName, {Function} eventListener |
事件绑定,事件命名统一挂载到require('echarts/config').EVENT(非模块化为echarts.config.EVENT)命名空间下,建议使用此命名空间作为事件名引用,当前版本支持事件有:
- REFRESH(刷新),RESTORE(还原),RESIZE(显示空间变化),CLICK(点击),HOVER(悬浮),
+ REFRESH(刷新),RESTORE(还原),RESIZE(显示空间变化),CLICK(点击),DBLCLICK(双击),HOVER(悬浮),
DATA_CHANGED(数据修改),DATA_VIEW_CHANGED(数据视图修改),
MAGIC_TYPE_CHANGED(动态类型切换),TIMELINE_CHANGED(时间轴变化),
DATA_ZOOM(数据区域缩放),DATA_RANGE(值域漫游),MAP_ROAM(地图漫游),
diff --git a/src/config.js b/src/config.js
index 6240dce3bca87c914e498505e2962ecf6e56f3b4..7aa6a3e20a0469a4d46510b024191ef95cda68e2 100644
--- a/src/config.js
+++ b/src/config.js
@@ -1177,6 +1177,7 @@ define(function() {
RESTORE: 'restore',
RESIZE: 'resize',
CLICK: 'click',
+ DBLCLICK: 'dblclick',
HOVER: 'hover',
//MOUSEWHEEL: 'mousewheel',
// -------业务交互逻辑
diff --git a/src/echarts.js b/src/echarts.js
index 7ce5e192b88ba67cb116b6c8172020a0cb41aa5b..2f56efed95946ac28fc506824d6943efac792413 100644
--- a/src/echarts.js
+++ b/src/echarts.js
@@ -135,7 +135,7 @@ define(function (require) {
* @type {Array}
*/
var ZR_EVENT_LISTENS = [
- 'CLICK', 'MOUSEOVER',
+ 'CLICK', 'DBLCLICK', 'MOUSEOVER',
'DRAGSTART', 'DRAGEND', 'DRAGENTER', 'DRAGOVER', 'DRAGLEAVE', 'DROP'
];
@@ -197,7 +197,7 @@ define(function (require) {
return self.__onevent(param);
};
for (var e in ecConfig.EVENT) {
- if (e != 'CLICK' && e != 'HOVER' && e != 'MAP_ROAM') {
+ if (e != 'CLICK' && e != 'DBLCLICK' && e != 'HOVER' && e != 'MAP_ROAM') {
this._messageCenter.bind(ecConfig.EVENT[e], this._onevent, this);
}
}
@@ -358,6 +358,25 @@ define(function (require) {
}
}
},
+
+ /**
+ * 双击事件,响应zrender事件,包装后分发到Echarts层
+ */
+ _ondblclick : function (param) {
+ callChartListMethodReverse(this, 'ondblclick', param);
+
+ if (param.target) {
+ var ecData = this._eventPackage(param.target);
+ if (ecData && ecData.seriesIndex != null) {
+ this._messageCenter.dispatch(
+ ecConfig.EVENT.DBLCLICK,
+ param.event,
+ ecData,
+ this
+ );
+ }
+ }
+ },
/**
* 鼠标移入事件,响应zrender事件,包装后分发到Echarts层
|