Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
b7f9894c
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,发现更多精彩内容 >>
提交
b7f9894c
编写于
3月 02, 2018
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://www.github.com/ecomfe/echarts
上级
d235dcc9
84579c3e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
36 addition
and
10 deletion
+36
-10
src/chart/helper/Symbol.js
src/chart/helper/Symbol.js
+10
-3
src/component/legend/LegendView.js
src/component/legend/LegendView.js
+11
-3
src/component/tooltip/TooltipView.js
src/component/tooltip/TooltipView.js
+1
-1
src/visual/symbol.js
src/visual/symbol.js
+12
-2
test/line.html
test/line.html
+2
-1
未找到文件。
src/chart/helper/Symbol.js
浏览文件 @
b7f9894c
...
...
@@ -38,7 +38,13 @@ function driftSymbol(dx, dy) {
this
.
parent
.
drift
(
dx
,
dy
);
}
symbolProto
.
_createSymbol
=
function
(
symbolType
,
data
,
idx
,
symbolSize
)
{
symbolProto
.
_createSymbol
=
function
(
symbolType
,
data
,
idx
,
symbolSize
,
keepAspect
)
{
// Remove paths created before
this
.
removeAll
();
...
...
@@ -51,7 +57,7 @@ symbolProto._createSymbol = function (symbolType, data, idx, symbolSize) {
// and macOS Sierra, a circle stroke become a rect, no matter what
// the scale is set. So we set width/height as 2. See #4150.
var
symbolPath
=
createSymbol
(
symbolType
,
-
1
,
-
1
,
2
,
2
,
color
symbolType
,
-
1
,
-
1
,
2
,
2
,
color
,
keepAspect
);
symbolPath
.
attr
({
...
...
@@ -152,7 +158,8 @@ symbolProto.updateData = function (data, idx, seriesScope) {
var
isInit
=
symbolType
!==
this
.
_symbolType
;
if
(
isInit
)
{
this
.
_createSymbol
(
symbolType
,
data
,
idx
,
symbolSize
);
var
keepAspect
=
data
.
getItemVisual
(
idx
,
'
symbolKeepAspect
'
);
this
.
_createSymbol
(
symbolType
,
data
,
idx
,
symbolSize
,
keepAspect
);
}
else
{
var
symbolPath
=
this
.
childAt
(
0
);
...
...
src/component/legend/LegendView.js
浏览文件 @
b7f9894c
...
...
@@ -197,6 +197,7 @@ export default echarts.extendComponentView({
var
itemWidth
=
legendModel
.
get
(
'
itemWidth
'
);
var
itemHeight
=
legendModel
.
get
(
'
itemHeight
'
);
var
inactiveColor
=
legendModel
.
get
(
'
inactiveColor
'
);
var
symbolKeepAspect
=
legendModel
.
get
(
'
symbolKeepAspect
'
);
var
isSelected
=
legendModel
.
isSelected
(
name
);
var
itemGroup
=
new
Group
();
...
...
@@ -217,7 +218,8 @@ export default echarts.extendComponentView({
itemWidth
,
itemHeight
,
isSelected
?
color
:
inactiveColor
,
true
// symbolKeepAspect default true for legend
symbolKeepAspect
==
null
?
true
:
symbolKeepAspect
));
// Compose symbols
...
...
@@ -232,8 +234,14 @@ export default echarts.extendComponentView({
}
// Put symbol in the center
itemGroup
.
add
(
createSymbol
(
symbolType
,
(
itemWidth
-
size
)
/
2
,
(
itemHeight
-
size
)
/
2
,
size
,
size
,
isSelected
?
color
:
inactiveColor
symbolType
,
(
itemWidth
-
size
)
/
2
,
(
itemHeight
-
size
)
/
2
,
size
,
size
,
isSelected
?
color
:
inactiveColor
,
// symbolKeepAspect default true for legend
symbolKeepAspect
==
null
?
true
:
symbolKeepAspect
));
}
...
...
src/component/tooltip/TooltipView.js
浏览文件 @
b7f9894c
...
...
@@ -657,7 +657,7 @@ export default echarts.extendComponentView({
},
dispose
:
function
(
ecModel
,
api
)
{
if
(
env
.
node
)
{
if
(
env
.
node
||
env
.
wxa
)
{
return
;
}
this
.
_tooltipContent
.
hide
();
...
...
src/visual/symbol.js
浏览文件 @
b7f9894c
...
...
@@ -9,11 +9,13 @@ export default function (seriesType, defaultSymbolType, legendSymbol) {
var
symbolType
=
seriesModel
.
get
(
'
symbol
'
)
||
defaultSymbolType
;
var
symbolSize
=
seriesModel
.
get
(
'
symbolSize
'
);
var
keepAspect
=
seriesModel
.
get
(
'
symbolKeepAspect
'
);
data
.
setVisual
({
legendSymbol
:
legendSymbol
||
symbolType
,
symbol
:
symbolType
,
symbolSize
:
symbolSize
symbolSize
:
symbolSize
,
symbolKeepAspect
:
keepAspect
});
// Only visible series has each data be visual encoded
...
...
@@ -34,7 +36,11 @@ export default function (seriesType, defaultSymbolType, legendSymbol) {
if
(
data
.
hasItemOption
)
{
var
itemModel
=
data
.
getItemModel
(
idx
);
var
itemSymbolType
=
itemModel
.
getShallow
(
'
symbol
'
,
true
);
var
itemSymbolSize
=
itemModel
.
getShallow
(
'
symbolSize
'
,
true
);
var
itemSymbolSize
=
itemModel
.
getShallow
(
'
symbolSize
'
,
true
);
var
itemSymbolKeepAspect
=
itemModel
.
getShallow
(
'
symbolKeepAspect
'
,
true
);
// If has item symbol
if
(
itemSymbolType
!=
null
)
{
data
.
setItemVisual
(
idx
,
'
symbol
'
,
itemSymbolType
);
...
...
@@ -43,6 +49,10 @@ export default function (seriesType, defaultSymbolType, legendSymbol) {
// PENDING Transform symbolSize ?
data
.
setItemVisual
(
idx
,
'
symbolSize
'
,
itemSymbolSize
);
}
if
(
itemSymbolKeepAspect
!=
null
)
{
data
.
setItemVisual
(
idx
,
'
symbolKeepAspect
'
,
itemSymbolKeepAspect
);
}
}
}
...
...
test/line.html
浏览文件 @
b7f9894c
...
...
@@ -151,7 +151,8 @@
name
:
'
line
'
,
type
:
'
line
'
,
stack
:
'
all
'
,
symbol
:
'
circle
'
,
symbol
:
'
path://M164,210.677v33.47l154.656,66.356L468,243.681v-33.004H164L164,210.677z M164,282.255L164,282.255v134.76h304V282.061l-149.012,66.615L164,282.255L164,282.255z
'
,
symbolKeepAspect
:
true
,
symbolSize
:
40
,
data
:
data1
,
itemStyle
:
itemStyle
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录