Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
z1593
incubator-echarts
提交
e7a9e503
I
incubator-echarts
项目概览
z1593
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e7a9e503
编写于
12月 29, 2018
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #9649 (on click, clear, throw error)
上级
225f8b3c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
67 addition
and
7 deletion
+67
-7
src/echarts.js
src/echarts.js
+9
-3
test/tooltip-setOption.html
test/tooltip-setOption.html
+58
-4
未找到文件。
src/echarts.js
浏览文件 @
e7a9e503
...
...
@@ -1508,7 +1508,7 @@ var MOUSE_EVENT_NAMES = [
*/
echartsProto
.
_initEvents
=
function
()
{
each
(
MOUSE_EVENT_NAMES
,
function
(
eveName
)
{
this
.
_zr
.
on
(
eveName
,
function
(
e
)
{
var
handler
=
function
(
e
)
{
var
ecModel
=
this
.
getModel
();
var
el
=
e
.
target
;
var
params
;
...
...
@@ -1577,8 +1577,14 @@ echartsProto._initEvents = function () {
this
.
trigger
(
eveName
,
params
);
}
},
this
);
};
// Consider that some component (like tooltip, brush, ...)
// register zr event handler, but user event handler might
// do anything, such as call `setOption` or `dispatchAction`,
// which probably update any of the content and probably
// cause problem if it is called previous other inner handlers.
handler
.
zrEventfulCallAtLast
=
true
;
this
.
_zr
.
on
(
eveName
,
handler
,
this
);
},
this
);
each
(
eventActionMap
,
function
(
actionType
,
eventType
)
{
...
...
test/tooltip-setOption.html
浏览文件 @
e7a9e503
...
...
@@ -48,13 +48,13 @@ under the License.
<div><a
target=
"_blank"
href=
"dynamicData.html"
>
dynamicData.html
</a></div>
<div><a
target=
"_blank"
href=
"dynamicData2.html"
>
dynamicData2.html
</a></div>
<div><a
target=
"_blank"
href=
"dynamicData3.html"
>
dynamicData3.html
</a></div>
<h1>
triggerOn
click
setOption when trigger axis (keep show)
</h1>
<
!-- <div class="chart" id="click-setOption1"></div> --
>
<h1>
triggerOn
: click,
setOption when trigger axis (keep show)
</h1>
<
div
class=
"chart"
id=
"click-setOption1"
></div
>
<h1>
tooltip should auto show and auto disappear when setOption(..., {notMerge: true})
</h1>
<div
class=
"chart"
id=
"setOption2"
>
</div>
<div
class=
"chart"
id=
"setOption2"
>
</div>
<
div
class=
"chart"
id=
"setOption3"
><
/div>
...
...
@@ -180,5 +180,59 @@ under the License.
<script>
require
([
'
echarts
'
],
function
(
echarts
)
{
var
colors
=
[
'
red
'
,
'
blue
'
];
var
option
=
{
color
:
colors
,
"
tooltip
"
:
{
"
show
"
:
true
},
"
xAxis
"
:
{
"
type
"
:
"
category
"
,
"
data
"
:
[
'
Mon
'
,
'
Tue
'
,
'
Wed
'
,
'
Thu
'
,
'
Fri
'
,
'
Sat
'
,
'
Sun
'
]
},
"
yAxis
"
:
{
},
"
series
"
:
[{
"
data
"
:
[
820
,
932
,
901
,
934
,
1290
,
1330
,
1320
],
"
type
"
:
'
bar
'
},
{
"
data
"
:
[
620
,
532
,
501
,
734
,
1090
,
1130
,
1220
],
"
type
"
:
'
bar
'
}]
};
var
myChart
=
testHelper
.
create
(
echarts
,
'
setOption3
'
,
{
title
:
'
Click the blue bar, should no error throw
'
,
option
:
option
});
myChart
.
on
(
'
click
'
,
function
(
params
)
{
myChart
.
clear
();
myChart
.
setOption
({
"
tooltip
"
:
{
"
show
"
:
true
},
"
xAxis
"
:
{
"
type
"
:
"
category
"
,
"
data
"
:
[
'
Mon
'
,
'
Tue
'
,
'
Wed
'
,
'
Thu
'
,
'
Fri
'
,
'
Sat
'
,
'
Sun
'
]
},
"
yAxis
"
:
{
},
"
series
"
:
[{
"
data
"
:
[
820
,
932
,
901
,
934
,
1290
,
1330
,
1320
],
"
type
"
:
'
bar
'
}]
});
});
});
</script>
</body>
</html>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录