Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
7955fd89
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,发现更多精彩内容 >>
提交
7955fd89
编写于
3月 16, 2021
作者:
O
Ovilia
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
WIP(legend): default symbolSize as 80% itemHeight while it can also inherit
上级
39d4e530
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
7 deletion
+22
-7
src/component/legend/LegendModel.ts
src/component/legend/LegendModel.ts
+3
-0
src/component/legend/LegendView.ts
src/component/legend/LegendView.ts
+19
-7
未找到文件。
src/component/legend/LegendModel.ts
浏览文件 @
7955fd89
...
...
@@ -123,6 +123,8 @@ export interface LegendStyleOption {
textStyle
?:
LabelOption
symbolKeepAspect
?:
boolean
symbolSize
?:
number
|
'
auto
'
|
'
inherit
'
}
interface
DataItem
extends
LegendStyleOption
{
...
...
@@ -449,6 +451,7 @@ class LegendModel<Ops extends LegendOption = LegendOption> extends ComponentMode
itemGap
:
10
,
itemWidth
:
25
,
itemHeight
:
14
,
symbolSize
:
'
auto
'
,
inactiveColor
:
'
#ccc
'
,
...
...
src/component/legend/LegendView.ts
浏览文件 @
7955fd89
...
...
@@ -184,9 +184,8 @@ class LegendView extends ComponentView {
!
seriesModel
.
get
(
'
legendHoverLink
'
)
&&
excludeSeriesId
.
push
(
seriesModel
.
id
);
});
each
(
legendModel
.
getData
(),
function
(
itemModel
,
dataIndex
)
{
const
name
=
itemModel
.
get
(
'
name
'
);
const
legendItemStyle
=
itemModel
.
getModel
(
'
itemStyle
'
).
getItemStyle
();
each
(
legendModel
.
getData
(),
function
(
legendItemModel
,
dataIndex
)
{
const
name
=
legendItemModel
.
get
(
'
name
'
);
// Use empty string or \n as a newline string
if
(
!
this
.
newlineDisabled
&&
(
name
===
''
||
name
===
'
\n
'
))
{
...
...
@@ -221,10 +220,13 @@ class LegendView extends ComponentView {
// Using rect symbol defaultly
const
legendSymbolType
=
data
.
getVisual
(
'
legendSymbol
'
)
||
'
roundRect
'
;
const
symbolType
=
data
.
getVisual
(
'
symbol
'
);
const
symbolSize
=
seriesModel
.
get
(
'
symbolSize
'
);
const
symbolSize
=
data
.
getVisual
(
'
symbolSize
'
);
data
.
getVisual
(
'
symbolSize
'
);
console
.
log
(
symbolSize
)
const
itemGroup
=
this
.
_createItem
(
name
,
dataIndex
,
i
temModel
,
legendModel
,
name
,
dataIndex
,
legendI
temModel
,
legendModel
,
legendSymbolType
,
symbolType
,
symbolSize
,
itemAlign
,
lineVisualStyle
,
style
,
true
,
selectMode
...
...
@@ -257,7 +259,7 @@ class LegendView extends ComponentView {
const
legendSymbolType
=
'
roundRect
'
;
const
itemGroup
=
this
.
_createItem
(
name
,
dataIndex
,
i
temModel
,
legendModel
,
name
,
dataIndex
,
legendI
temModel
,
legendModel
,
legendSymbolType
,
null
,
null
,
itemAlign
,
{},
style
,
false
,
selectMode
...
...
@@ -358,8 +360,18 @@ class LegendView extends ComponentView {
const
inactiveBorderColor
=
itemModel
.
get
(
'
inactiveBorderColor
'
);
const
symbolKeepAspect
=
itemModel
.
get
(
'
symbolKeepAspect
'
);
const
legendSymbolSize
=
itemModel
.
get
(
'
symbolSize
'
);
if
(
legendSymbolSize
===
'
auto
'
)
{
// auto: 80% itemHeight
symbolSize
=
itemHeight
*
0.8
;
}
else
if
(
legendSymbolSize
!==
'
inherit
'
)
{
// number: legend.symbolSize
symbolSize
=
Math
.
min
(
legendSymbolSize
,
itemHeight
);
}
// inherit: series.symbolSize, which is passed in by function parameter
const
style
=
getLegendStyle
(
itemModel
,
lineVisualStyle
,
itemVisualStyle
,
isColorBySeries
);
console
.
log
(
style
)
symbolType
=
symbolType
||
'
roundRect
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录