Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
d6c8cbcd
I
incubator-echarts
项目概览
x649585723
/
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,体验更适合开发者的 AI 搜索 >>
提交
d6c8cbcd
编写于
4月 29, 2014
作者:
K
kener
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
高亮关联优化
上级
6379fa79
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
44 addition
and
30 deletion
+44
-30
src/chart/map.js
src/chart/map.js
+11
-22
src/component/base.js
src/component/base.js
+24
-0
src/component/legend.js
src/component/legend.js
+9
-8
未找到文件。
src/chart/map.js
浏览文件 @
d6c8cbcd
...
...
@@ -43,16 +43,6 @@ define(function (require) {
this
.
messageCenter
=
messageCenter
;
var
self
=
this
;
/**
* 输出关联区域
*/
self
.
shapeHandler
.
onmouseover
=
function
(
param
)
{
var
target
=
param
.
target
;
var
name
=
target
.
style
.
_text
;
if
(
self
.
_shapeListMap
[
name
])
{
self
.
zr
.
addHoverShape
(
self
.
_shapeListMap
[
name
]);
}
};
self
.
_onmousewheel
=
function
(
param
){
return
self
.
__onmousewheel
(
param
);
};
...
...
@@ -229,12 +219,6 @@ define(function (require) {
self
.
_shapeListMap
=
{};
for
(
var
i
=
0
,
l
=
self
.
shapeList
.
length
;
i
<
l
;
i
++
)
{
self
.
zr
.
addShape
(
self
.
shapeList
[
i
]);
// 通过name关联shape,用于onmouseover
if
(
self
.
shapeList
[
i
].
type
==
'
path
'
&&
typeof
self
.
shapeList
[
i
].
style
.
_text
!=
'
undefined
'
)
{
self
.
_shapeListMap
[
self
.
shapeList
[
i
].
style
.
_text
]
=
self
.
shapeList
[
i
];
}
}
self
.
zr
.
refresh
();
if
(
!
self
.
_markAnimation
)
{
...
...
@@ -395,7 +379,8 @@ define(function (require) {
});
}
//console.log(JSON.stringify(province));
//console.log(JSON.stringify(this._mapDataMap[mapType].transform));
return
province
;
},
...
...
@@ -811,20 +796,24 @@ define(function (require) {
}
}
textShape
=
new
TextShape
(
textShape
);
shape
=
new
PathShape
(
shape
);
if
(
typeof
data
.
hoverable
!=
'
undefined
'
)
{
// 数据级优先
textShape
.
hoverable
=
shape
.
hoverable
=
data
.
hoverable
;
if
(
data
.
hoverable
)
{
textShape
.
onmouseover
=
this
.
shapeHandler
.
onmouseover
;
textShape
.
hoverConnect
=
shape
.
id
;
textShape
.
onmouseover
=
this
.
hoverConnect
;
}
}
else
if
(
this
.
_hoverable
[
mapType
]){
// 系列级,补充一个关联响应
textShape
.
onmouseover
=
this
.
shapeHandler
.
onmouseover
;
textShape
.
hoverConnect
=
shape
.
id
;
textShape
.
onmouseover
=
this
.
hoverConnect
;
}
// console.log(name,shape);
ecData
.
pack
(
textShape
,
{
...
...
@@ -835,7 +824,7 @@ define(function (require) {
data
,
0
,
name
);
this
.
shapeList
.
push
(
new
TextShape
(
textShape
)
);
this
.
shapeList
.
push
(
textShape
);
ecData
.
pack
(
shape
,
...
...
@@ -847,7 +836,7 @@ define(function (require) {
data
,
0
,
name
);
this
.
shapeList
.
push
(
new
PathShape
(
shape
)
);
this
.
shapeList
.
push
(
shape
);
}
//console.log(this._selected);
},
...
...
src/component/base.js
浏览文件 @
d6c8cbcd
...
...
@@ -40,6 +40,21 @@ define(function (require) {
this
.
_zlevelBase
=
this
.
getZlevelBase
();
this
.
shapeList
=
[];
this
.
effectList
=
[];
var
self
=
this
;
self
.
hoverConnect
=
function
(
param
)
{
var
target
=
(
param
.
target
||
{}).
hoverConnect
;
if
(
target
)
{
if
(
!
(
target
instanceof
Array
))
{
self
.
zr
.
addHoverShape
(
self
.
getShapeById
(
target
));
}
else
{
for
(
var
i
=
0
,
l
=
target
.
length
;
i
<
l
;
i
++
)
{
self
.
zr
.
addHoverShape
(
self
.
getShapeById
(
target
[
i
]));
}
}
}
}
}
/**
...
...
@@ -129,6 +144,15 @@ define(function (require) {
}
},
getShapeById
:
function
(
id
)
{
for
(
var
i
=
0
,
l
=
this
.
shapeList
.
length
;
i
<
l
;
i
++
)
{
if
(
this
.
shapeList
[
i
].
id
==
id
)
{
return
this
.
shapeList
[
i
];
}
}
return
null
;
},
/**
* 获取自定义和默认配置合并后的字体设置
*/
...
...
src/component/legend.js
浏览文件 @
d6c8cbcd
...
...
@@ -147,12 +147,7 @@ define(function (require) {
color
);
itemShape
.
_name
=
itemName
;
if
(
this
.
legendOption
.
selectedMode
)
{
itemShape
.
onclick
=
function
(
param
)
{
self
.
_legendSelected
(
param
);
};
}
this
.
shapeList
.
push
(
new
IconShape
(
itemShape
));
itemShape
=
new
IconShape
(
itemShape
);
// 文字
textShape
=
{
...
...
@@ -184,12 +179,18 @@ define(function (require) {
}
textShape
.
_name
=
itemName
;
textShape
=
new
TextShape
(
textShape
);
if
(
this
.
legendOption
.
selectedMode
)
{
textShape
.
onclick
=
function
(
param
)
{
itemShape
.
onclick
=
textShape
.
onclick
=
function
(
param
)
{
self
.
_legendSelected
(
param
);
};
itemShape
.
onmouseover
=
textShape
.
onmouseover
=
this
.
hoverConnect
;
itemShape
.
hoverConnect
=
textShape
.
id
;
textShape
.
hoverConnect
=
itemShape
.
id
;
}
this
.
shapeList
.
push
(
new
TextShape
(
textShape
));
this
.
shapeList
.
push
(
itemShape
);
this
.
shapeList
.
push
(
textShape
);
if
(
this
.
legendOption
.
orient
==
'
horizontal
'
)
{
lastX
+=
itemWidth
+
5
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录