Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
半栈学徒
incubator-echarts
提交
e12e9912
I
incubator-echarts
项目概览
半栈学徒
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
5
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 搜索 >>
提交
e12e9912
编写于
1月 04, 2019
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix radar line disappear on hover when there is empty value in data.
上级
e2936025
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
6 deletion
+22
-6
src/chart/radar/RadarView.js
src/chart/radar/RadarView.js
+5
-1
src/chart/radar/radarLayout.js
src/chart/radar/radarLayout.js
+15
-3
test/radar.html
test/radar.html
+2
-2
未找到文件。
src/chart/radar/RadarView.js
浏览文件 @
e12e9912
...
...
@@ -103,6 +103,7 @@ export default echarts.extendChartView({
points
:
points
}
};
polygon
.
shape
.
points
=
getInitialPoints
(
points
);
polyline
.
shape
.
points
=
getInitialPoints
(
points
);
graphic
.
initProps
(
polygon
,
target
,
seriesModel
,
idx
);
...
...
@@ -130,6 +131,7 @@ export default echarts.extendChartView({
points
:
data
.
getItemLayout
(
newIdx
)
}
};
if
(
!
target
.
shape
.
points
)
{
return
;
}
...
...
@@ -193,6 +195,8 @@ export default echarts.extendChartView({
symbolGroup
.
eachChild
(
function
(
symbolPath
)
{
symbolPath
.
setStyle
(
itemStyle
);
symbolPath
.
hoverStyle
=
zrUtil
.
clone
(
itemHoverStyle
);
var
defaultText
=
data
.
get
(
data
.
dimensions
[
symbolPath
.
__dimIdx
],
idx
);
(
defaultText
==
null
||
isNaN
(
defaultText
))
&&
(
defaultText
=
''
);
graphic
.
setLabelStyle
(
symbolPath
.
style
,
symbolPath
.
hoverStyle
,
labelModel
,
labelHoverModel
,
...
...
@@ -200,7 +204,7 @@ export default echarts.extendChartView({
labelFetcher
:
data
.
hostModel
,
labelDataIndex
:
idx
,
labelDimIndex
:
symbolPath
.
__dimIdx
,
defaultText
:
d
ata
.
get
(
data
.
dimensions
[
symbolPath
.
__dimIdx
],
idx
)
,
defaultText
:
d
efaultText
,
autoColor
:
color
,
isRectText
:
true
}
...
...
src/chart/radar/radarLayout.js
浏览文件 @
e12e9912
...
...
@@ -33,7 +33,9 @@ export default function (ecModel) {
zrUtil
.
each
(
axes
,
function
(
axis
,
axisIndex
)
{
data
.
each
(
data
.
mapDimension
(
axes
[
axisIndex
].
dim
),
function
(
val
,
dataIndex
)
{
points
[
dataIndex
]
=
points
[
dataIndex
]
||
[];
points
[
dataIndex
][
axisIndex
]
=
coordSys
.
dataToPoint
(
val
,
axisIndex
);
var
point
=
coordSys
.
dataToPoint
(
val
,
axisIndex
);
points
[
dataIndex
][
axisIndex
]
=
isValidPoint
(
point
)
?
point
:
getValueMissingPoint
(
coordSys
);
});
});
...
...
@@ -43,12 +45,22 @@ export default function (ecModel) {
// Is it appropriate to connect to the next data when some data is missing?
// Or, should trade it like `connectNull` in line chart?
var
firstPoint
=
zrUtil
.
find
(
points
[
idx
],
function
(
point
)
{
return
!
isNaN
(
point
[
0
])
&&
!
isNaN
(
point
[
1
]
);
})
||
[
NaN
,
NaN
]
;
return
isValidPoint
(
point
);
})
||
getValueMissingPoint
(
coordSys
)
;
// Copy the first actual point to the end of the array
points
[
idx
].
push
(
firstPoint
.
slice
());
data
.
setItemLayout
(
idx
,
points
[
idx
]);
});
});
}
function
isValidPoint
(
point
)
{
return
!
isNaN
(
point
[
0
])
&&
!
isNaN
(
point
[
1
]);
}
function
getValueMissingPoint
(
coordSys
)
{
// It is error-prone to input [NaN, NaN] into polygon, polygon.
// (probably cause problem when refreshing or animating)
return
[
coordSys
.
cx
,
coordSys
.
cy
];
}
\ No newline at end of file
test/radar.html
浏览文件 @
e12e9912
...
...
@@ -49,7 +49,7 @@ under the License.
},
tooltip
:
{},
legend
:
{
data
:
[
'
预算分配(Allocated Budget)
'
,
'
实际开销(Actual Spending)
'
,
'
第一个元素是 null
'
]
data
:
[
'
预算分配(Allocated Budget)
'
,
'
实际开销(Actual Spending)
含有 "-" 数据
'
,
'
第一个元素是 null
'
]
},
radar
:
{
radius
:
[
50
,
'
70%
'
],
...
...
@@ -84,7 +84,7 @@ under the License.
},
{
value
:
[
50
,
14000
,
28000
,
31000
,
'
-
'
,
21000
],
name
:
'
实际开销(Actual Spending)
'
name
:
'
实际开销(Actual Spending)
含有 "-" 数据
'
},
{
value
:
[
'
-
'
,
8000
,
20000
,
20000
,
40000
,
10000
],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录