Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
26fb8a5f
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,发现更多精彩内容 >>
提交
26fb8a5f
编写于
1月 06, 2016
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Map label improvement
上级
97adb3d9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
36 addition
and
16 deletion
+36
-16
src/chart/map/MapView.js
src/chart/map/MapView.js
+36
-14
src/component/helper/MapDraw.js
src/component/helper/MapDraw.js
+0
-2
未找到文件。
src/chart/map/MapView.js
浏览文件 @
26fb8a5f
...
...
@@ -54,9 +54,6 @@ define(function (require) {
if
(
isNaN
(
value
))
{
return
;
}
var
itemModel
=
data
.
getItemModel
(
idx
);
var
labelModel
=
itemModel
.
getModel
(
'
label.normal
'
);
var
textStyleModel
=
labelModel
.
getModel
(
'
textStyle
'
);
var
layout
=
data
.
getItemLayout
(
idx
);
...
...
@@ -68,12 +65,6 @@ define(function (require) {
var
point
=
layout
.
point
;
var
offset
=
layout
.
offset
;
var
showLabel
=
labelModel
.
get
(
'
show
'
);
var
labelText
=
data
.
getName
(
idx
);
var
labelColor
=
textStyleModel
.
getTextColor
();
var
labelFont
=
textStyleModel
.
getFont
();
var
circle
=
new
graphic
.
Circle
({
style
:
{
fill
:
data
.
getVisual
(
'
color
'
)
...
...
@@ -87,13 +78,44 @@ define(function (require) {
z2
:
10
});
if
(
showLabel
&&
!
offset
)
{
// First data on the same region
if
(
!
offset
)
{
var
labelText
=
data
.
getName
(
idx
);
var
itemModel
=
data
.
getItemModel
(
idx
);
var
labelModel
=
itemModel
.
getModel
(
'
label.normal
'
);
var
hoverLabelModel
=
itemModel
.
getModel
(
'
label.emphasis
'
);
var
textStyleModel
=
labelModel
.
getModel
(
'
textStyle
'
);
var
hoverTextStyleModel
=
hoverLabelModel
.
getModel
(
'
textStyle
'
);
var
polygonGroups
=
data
.
getItemGraphicEl
(
idx
);
circle
.
setStyle
({
text
:
labelText
,
textFill
:
labelColor
,
textPosition
:
'
bottom
'
,
textFont
:
labelFont
textPosition
:
'
bottom
'
});
var
onEmphasis
=
function
()
{
circle
.
setStyle
({
text
:
hoverLabelModel
.
get
(
'
show
'
)
?
labelText
:
''
,
textFill
:
hoverTextStyleModel
.
getTextColor
(),
textFont
:
hoverTextStyleModel
.
getFont
()
});
};
var
onNormal
=
function
()
{
circle
.
setStyle
({
text
:
labelModel
.
get
(
'
show
'
)
?
labelText
:
''
,
textFill
:
textStyleModel
.
getTextColor
(),
textFont
:
textStyleModel
.
getFont
()
});
};
polygonGroups
.
on
(
'
mouseover
'
,
onEmphasis
)
.
on
(
'
mouseout
'
,
onNormal
)
.
on
(
'
emphasis
'
,
onEmphasis
)
.
on
(
'
normal
'
,
onNormal
);
onNormal
();
}
group
.
add
(
circle
);
...
...
src/component/helper/MapDraw.js
浏览文件 @
26fb8a5f
...
...
@@ -167,11 +167,9 @@ define(function (require) {
// In the following cases label will be drawn
// 1. In map series and data value is NaN
// 2. In geo component
// 3. Data value is not NaN and label only shows on hover
// 4. Region has no series legendSymbol, which will be add a showLabel flag in mapSymbolLayout
if
(
(
!
data
||
isDataNaN
&&
(
showLabel
||
hoverShowLabel
))
||
(
data
&&
!
isDataNaN
&&
(
!
showLabel
&&
hoverShowLabel
))
||
(
itemLayout
&&
itemLayout
.
showLabel
)
)
{
var
query
=
data
?
dataIdx
:
region
.
name
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录