Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
627b17e1
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 搜索 >>
提交
627b17e1
编写于
10月 23, 2020
作者:
O
Ovilia
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(decal): support legend icon decal
上级
a5fb2fd2
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
11 addition
and
6 deletion
+11
-6
src/component/legend/LegendView.ts
src/component/legend/LegendView.ts
+10
-4
test/decal.html
test/decal.html
+1
-2
未找到文件。
src/component/legend/LegendView.ts
浏览文件 @
627b17e1
...
...
@@ -41,6 +41,7 @@ import Model from '../../model/Model';
import
Displayable
,
{
DisplayableState
}
from
'
zrender/src/graphic/Displayable
'
;
import
{
PathStyleProps
}
from
'
zrender/src/graphic/Path
'
;
import
{
parse
,
stringify
}
from
'
zrender/src/tool/color
'
;
import
{
Pattern
}
from
'
zrender/src/export
'
;
const
curry
=
zrUtil
.
curry
;
const
each
=
zrUtil
.
each
;
...
...
@@ -199,6 +200,7 @@ class LegendView extends ComponentView {
const
style
=
data
.
getVisual
(
'
style
'
);
const
color
=
style
[
data
.
getVisual
(
'
drawType
'
)]
||
style
.
fill
;
const
borderColor
=
style
.
stroke
;
const
decal
=
style
.
decal
;
// Using rect symbol defaultly
const
legendSymbolType
=
data
.
getVisual
(
'
legendSymbol
'
)
||
'
roundRect
'
;
...
...
@@ -207,7 +209,7 @@ class LegendView extends ComponentView {
const
itemGroup
=
this
.
_createItem
(
name
,
dataIndex
,
itemModel
,
legendModel
,
legendSymbolType
,
symbolType
,
itemAlign
,
color
,
borderColor
,
itemAlign
,
color
,
borderColor
,
decal
,
selectMode
);
...
...
@@ -236,6 +238,7 @@ class LegendView extends ComponentView {
const
style
=
provider
.
getItemVisual
(
idx
,
'
style
'
)
as
PathStyleProps
;
const
borderColor
=
style
.
stroke
;
const
decal
=
style
.
decal
;
let
color
=
style
.
fill
;
const
colorArr
=
parse
(
style
.
fill
as
ColorString
);
// Color may be set to transparent in visualMap when data is out of range.
...
...
@@ -251,7 +254,7 @@ class LegendView extends ComponentView {
const
itemGroup
=
this
.
_createItem
(
name
,
dataIndex
,
itemModel
,
legendModel
,
legendSymbolType
,
null
,
itemAlign
,
color
,
borderColor
,
itemAlign
,
color
,
borderColor
,
decal
,
selectMode
);
...
...
@@ -333,6 +336,7 @@ class LegendView extends ComponentView {
itemAlign
:
LegendOption
[
'
align
'
],
color
:
ZRColor
,
borderColor
:
ZRColor
,
decal
:
Pattern
,
selectMode
:
LegendOption
[
'
selectedMode
'
]
)
{
const
itemWidth
=
legendModel
.
get
(
'
itemWidth
'
);
...
...
@@ -367,7 +371,7 @@ class LegendView extends ComponentView {
itemGroup
.
add
(
setSymbolStyle
(
legendSymbol
,
legendSymbolType
,
legendModelItemStyle
,
borderColor
,
inactiveBorderColor
,
isSelected
borderColor
,
inactiveBorderColor
,
decal
,
isSelected
)
);
...
...
@@ -395,7 +399,7 @@ class LegendView extends ComponentView {
itemGroup
.
add
(
setSymbolStyle
(
legendSymbolCenter
,
symbolType
,
legendModelItemStyle
,
borderColor
,
inactiveBorderColor
,
isSelected
borderColor
,
inactiveBorderColor
,
decal
,
isSelected
)
);
}
...
...
@@ -550,12 +554,14 @@ function setSymbolStyle(
legendModelItemStyle
:
Model
<
ItemStyleOption
>
,
borderColor
:
ZRColor
,
inactiveBorderColor
:
ZRColor
,
decal
:
Pattern
,
isSelected
:
boolean
)
{
let
itemStyle
;
if
(
symbolType
!==
'
line
'
&&
symbolType
.
indexOf
(
'
empty
'
)
<
0
)
{
itemStyle
=
legendModelItemStyle
.
getItemStyle
();
(
symbol
as
graphic
.
Path
).
style
.
stroke
=
borderColor
;
(
symbol
as
graphic
.
Path
).
style
.
decal
=
decal
;
if
(
!
isSelected
)
{
itemStyle
.
stroke
=
inactiveBorderColor
;
}
...
...
test/decal.html
浏览文件 @
627b17e1
...
...
@@ -180,8 +180,7 @@ under the License.
decal
:
{
show
:
true
}
},
animationDurationUpdate
:
10000
}
};
var
chart
=
testHelper
.
create
(
echarts
,
'
main0
'
,
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录