Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
27aab498
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,发现更多精彩内容 >>
提交
27aab498
编写于
10月 11, 2017
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support strokeWidth and strokeColor. Fix #6804
上级
60c59a60
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
32 addition
and
5 deletion
+32
-5
src/chart/treemap/TreemapView.js
src/chart/treemap/TreemapView.js
+29
-4
test/treemap-disk2.html
test/treemap-disk2.html
+3
-1
未找到文件。
src/chart/treemap/TreemapView.js
浏览文件 @
27aab498
...
...
@@ -9,6 +9,8 @@
var
BoundingRect
=
require
(
'
zrender/core/BoundingRect
'
);
var
matrix
=
require
(
'
zrender/core/matrix
'
);
var
animationUtil
=
require
(
'
../../util/animation
'
);
var
makeStyleMapper
=
require
(
'
../../model/mixin/makeStyleMapper
'
);
var
bind
=
zrUtil
.
bind
;
var
Group
=
graphic
.
Group
;
var
Rect
=
graphic
.
Rect
;
...
...
@@ -23,6 +25,25 @@
var
Z_BG
=
1
;
var
Z_CONTENT
=
2
;
var
getItemStyleEmphasis
=
makeStyleMapper
([
[
'
fill
'
,
'
color
'
],
// `borderColor` and `borderWidth` has been occupied,
// so use `stroke` to indicate the stroke of the rect.
[
'
stroke
'
,
'
strokeColor
'
],
[
'
lineWidth
'
,
'
strokeWidth
'
],
[
'
shadowBlur
'
],
[
'
shadowOffsetX
'
],
[
'
shadowOffsetY
'
],
[
'
shadowColor
'
]
]);
var
getItemStyleNormal
=
function
(
model
)
{
// Normal style props should include emphasis style props.
var
itemStyle
=
getItemStyleEmphasis
(
model
);
// Clear styles set by emphasis.
itemStyle
.
stroke
=
itemStyle
.
fill
=
itemStyle
.
lineWidth
=
null
;
return
itemStyle
;
};
return
require
(
'
../../echarts
'
).
extendChartView
({
type
:
'
treemap
'
,
...
...
@@ -657,6 +678,7 @@
var
thisViewChildren
=
thisNode
.
viewChildren
;
var
upperHeight
=
thisLayout
.
upperHeight
;
var
isParent
=
thisViewChildren
&&
thisViewChildren
.
length
;
var
itemStyleNormalModel
=
thisNode
.
getModel
(
'
itemStyle.normal
'
);
var
itemStyleEmphasisModel
=
thisNode
.
getModel
(
'
itemStyle.emphasis
'
);
// End of closure ariables available in "Procedures in renderNode".
...
...
@@ -705,8 +727,10 @@
var
emphasisBorderColor
=
itemStyleEmphasisModel
.
get
(
'
borderColor
'
);
updateStyle
(
bg
,
function
()
{
var
normalStyle
=
{
fill
:
visualBorderColor
};
var
emphasisStyle
=
{
fill
:
emphasisBorderColor
};
var
normalStyle
=
getItemStyleNormal
(
itemStyleNormalModel
);
normalStyle
.
fill
=
visualBorderColor
;
var
emphasisStyle
=
getItemStyleEmphasis
(
itemStyleEmphasisModel
);
emphasisStyle
.
fill
=
emphasisBorderColor
;
if
(
useUpperLabel
)
{
var
upperLabelWidth
=
thisWidth
-
2
*
borderWidth
;
...
...
@@ -746,8 +770,9 @@
var
visualColor
=
thisNode
.
getVisual
(
'
color
'
,
true
);
updateStyle
(
content
,
function
()
{
var
normalStyle
=
{
fill
:
visualColor
};
var
emphasisStyle
=
itemStyleEmphasisModel
.
getItemStyle
();
var
normalStyle
=
getItemStyleNormal
(
itemStyleNormalModel
);
normalStyle
.
fill
=
visualColor
;
var
emphasisStyle
=
getItemStyleEmphasis
(
itemStyleEmphasisModel
);
prepareText
(
normalStyle
,
emphasisStyle
,
visualColor
,
contentWidth
,
contentHeight
);
...
...
test/treemap-disk2.html
浏览文件 @
27aab498
...
...
@@ -99,9 +99,11 @@
},
itemStyle
:
{
normal
:
{
borderColor
:
'
#fff
'
//
borderColor: '#fff'
},
emphasis
:
{
strokeColor
:
'
yellow
'
,
strokeWidth
:
2
}
},
levels
:
[
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录