Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
a499570c
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 搜索 >>
提交
a499570c
编写于
9月 29, 2020
作者:
P
pissang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(line): fix default formatter not apply value animation in endLabel
上级
c1e0f404
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
6 deletion
+11
-6
src/chart/line/LineView.ts
src/chart/line/LineView.ts
+7
-4
src/label/labelStyle.ts
src/label/labelStyle.ts
+4
-2
未找到文件。
src/chart/line/LineView.ts
浏览文件 @
a499570c
...
...
@@ -52,11 +52,10 @@ import { setStatesStylesFromModel, setStatesFlag, enableHoverEmphasis } from '..
import
Displayable
from
'
zrender/src/graphic/Displayable
'
;
import
Model
from
'
../../model/Model
'
;
import
{
setLabelStyle
,
getLabelStatesModels
,
labelInner
}
from
'
../../label/labelStyle
'
;
import
{
getDefaultLabel
}
from
'
../helper/labelHelper
'
;
import
{
getDefaultLabel
,
getDefaultInterpolatedLabel
}
from
'
../helper/labelHelper
'
;
import
{
getECData
}
from
'
../../util/innerStore
'
;
import
{
createFloat32Array
}
from
'
../../util/vendor
'
;
import
Cartesian
from
'
../../coord/cartesian/Cartesian
'
;
type
PolarArea
=
ReturnType
<
Polar
[
'
getArea
'
]
>
;
type
Cartesian2DArea
=
ReturnType
<
Cartesian2D
[
'
getArea
'
]
>
;
...
...
@@ -983,6 +982,7 @@ class LineView extends ChartView {
const
endLabelModel
=
seriesModel
.
getModel
(
'
endLabel
'
);
if
(
endLabelModel
.
get
(
'
show
'
))
{
const
data
=
seriesModel
.
getData
();
const
polyline
=
this
.
_polyline
;
let
endLabel
=
this
.
_endLabel
;
if
(
!
endLabel
)
{
...
...
@@ -1003,7 +1003,10 @@ class LineView extends ChartView {
{
labelFetcher
:
seriesModel
,
labelDataIndex
:
dataIndex
,
defaultText
:
getDefaultLabel
(
seriesModel
.
getData
(),
dataIndex
),
defaultText
(
dataIndex
,
opt
,
overrideValue
)
{
return
overrideValue
?
getDefaultInterpolatedLabel
(
data
,
overrideValue
)
:
getDefaultLabel
(
data
,
dataIndex
);
},
enableTextSetter
:
true
},
getEndLabelStateSpecified
(
endLabelModel
,
coordSys
)
...
...
@@ -1083,7 +1086,7 @@ class LineView extends ChartView {
endLabel
.
attr
({
x
:
pt
[
0
],
y
:
pt
[
1
]
});
}
if
(
valueAnimation
)
{
labelInner
(
endLabel
).
setLabelText
(
value
);
labelInner
(
endLabel
).
setLabelText
(
value
,
);
}
}
}
...
...
src/label/labelStyle.ts
浏览文件 @
a499570c
...
...
@@ -42,7 +42,9 @@ type TextCommonParams = {
const
EMPTY_OBJ
=
{};
interface
SetLabelStyleOpt
<
LDI
>
extends
TextCommonParams
{
defaultText
?:
string
|
((
labelDataIndex
:
LDI
,
opt
:
SetLabelStyleOpt
<
LDI
>
)
=>
string
);
defaultText
?:
string
|
((
labelDataIndex
:
LDI
,
opt
:
SetLabelStyleOpt
<
LDI
>
,
overrideValue
?:
ParsedValue
|
ParsedValue
[]
)
=>
string
);
// Fetch text by:
// opt.labelFetcher.getFormattedLabel(
// opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp
...
...
@@ -115,7 +117,7 @@ export function getLabelText<LDI>(
);
}
if
(
baseText
==
null
)
{
baseText
=
isFunction
(
opt
.
defaultText
)
?
opt
.
defaultText
(
labelDataIndex
,
opt
)
:
opt
.
defaultText
;
baseText
=
isFunction
(
opt
.
defaultText
)
?
opt
.
defaultText
(
labelDataIndex
,
opt
,
overrideValue
)
:
opt
.
defaultText
;
}
const
statesText
=
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录