Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
752a288d
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,发现更多精彩内容 >>
提交
752a288d
编写于
4月 27, 2018
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix stack on time axis.
上级
44c157fb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
168 addition
and
2 deletion
+168
-2
src/data/helper/dataStackHelper.js
src/data/helper/dataStackHelper.js
+7
-1
test/area-stack.html
test/area-stack.html
+161
-1
未找到文件。
src/data/helper/dataStackHelper.js
浏览文件 @
752a288d
...
@@ -72,10 +72,16 @@ export function enableDataStack(seriesModel, dimensionInfoList, opt) {
...
@@ -72,10 +72,16 @@ export function enableDataStack(seriesModel, dimensionInfoList, opt) {
}
}
});
});
if
(
stackedDimInfo
&&
!
byIndex
&&
!
stackedByDimInfo
)
{
// Compatible with previous design, value axis (time axis) only stack by index.
// It may make sense if the user provides elaborately constructed data.
byIndex
=
true
;
}
// Add stack dimension, they can be both calculated by coordinate system in `unionExtent`.
// Add stack dimension, they can be both calculated by coordinate system in `unionExtent`.
// That put stack logic in List is for using conveniently in echarts extensions, but it
// That put stack logic in List is for using conveniently in echarts extensions, but it
// might not be a good way.
// might not be a good way.
if
(
stackedDimInfo
&&
(
byIndex
||
stackedByDimInfo
)
)
{
if
(
stackedDimInfo
)
{
// Use a weird name that not duplicated with other names.
// Use a weird name that not duplicated with other names.
stackResultDimension
=
'
__
\
0ecstackresult
'
;
stackResultDimension
=
'
__
\
0ecstackresult
'
;
stackedOverDimension
=
'
__
\
0ecstackedover
'
;
stackedOverDimension
=
'
__
\
0ecstackedover
'
;
...
...
test/area-stack.html
浏览文件 @
752a288d
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
<div
id=
"main0"
></div>
<div
id=
"main0"
></div>
<div
id=
"main1"
></div>
<div
id=
"main1"
></div>
<div
id=
"main2"
></div>
...
@@ -400,5 +400,165 @@
...
@@ -400,5 +400,165 @@
</script>
</script>
<script>
var
chart
;
var
myChart
;
var
option
;
require
([
'
echarts
'
],
function
(
echarts
)
{
var
data
=
[
[[
"
2016-10-4
"
,
44
],[
"
2016-10-5
"
,
54
],[
"
2016-10-6
"
,
47
],[
"
2016-10-7
"
,
37
],[
"
2016-10-8
"
,
36
],[
"
2016-10-9
"
,
30
],[
"
2016-10-10
"
,
20
],[
"
2016-10-11
"
,
21
],[
"
2016-10-12
"
,
29
]],
[[
"
2016-10-4
"
,
28
],[
"
2016-10-5
"
,
38
],[
"
2016-10-6
"
,
44
],[
"
2016-10-7
"
,
40
],[
"
2016-10-8
"
,
42
],[
"
2016-10-9
"
,
39
],[
"
2016-10-10
"
,
46
],[
"
2016-10-11
"
,
50
],[
"
2016-10-12
"
,
46
]]
];
var
option
=
{
legend
:
{
},
tooltip
:
{
triggerOn
:
'
none
'
,
position
:
function
(
pt
)
{
return
[
pt
[
0
],
130
];
}
},
toolbox
:
{
left
:
'
center
'
,
itemSize
:
25
,
top
:
55
,
feature
:
{
dataZoom
:
{
yAxisIndex
:
'
none
'
},
restore
:
{}
}
},
xAxis
:
{
type
:
'
time
'
,
axisPointer
:
{
value
:
'
2016-10-7
'
,
snap
:
true
,
lineStyle
:
{
color
:
'
#004E52
'
,
opacity
:
0.5
,
width
:
2
},
label
:
{
show
:
true
,
formatter
:
function
(
params
)
{
return
echarts
.
format
.
formatTime
(
'
yyyy-MM-dd
'
,
params
.
value
);
},
backgroundColor
:
'
#004E52
'
},
handle
:
{
show
:
true
,
color
:
'
#004E52
'
}
},
splitLine
:
{
show
:
false
}
},
yAxis
:
{
type
:
'
value
'
,
axisTick
:
{
inside
:
true
},
splitLine
:
{
show
:
false
},
axisLabel
:
{
inside
:
true
,
formatter
:
'
{value}
\n
'
},
z
:
10
},
grid
:
{
top
:
110
,
left
:
15
,
right
:
15
,
height
:
160
},
dataZoom
:
[{
type
:
'
inside
'
,
throttle
:
50
}],
series
:
[
{
name
:
'
line1
'
,
type
:
'
line
'
,
smooth
:
true
,
symbol
:
'
circle
'
,
symbolSize
:
5
,
sampling
:
'
average
'
,
itemStyle
:
{
normal
:
{
color
:
'
#8ec6ad
'
}
},
stack
:
'
a
'
,
areaStyle
:
{
normal
:
{
color
:
new
echarts
.
graphic
.
LinearGradient
(
0
,
0
,
0
,
1
,
[{
offset
:
0
,
color
:
'
#8ec6ad
'
},
{
offset
:
1
,
color
:
'
#ffe
'
}])
}
},
data
:
data
[
0
]
},
{
name
:
'
line2
'
,
type
:
'
line
'
,
smooth
:
true
,
stack
:
'
a
'
,
symbol
:
'
circle
'
,
symbolSize
:
5
,
sampling
:
'
average
'
,
itemStyle
:
{
normal
:
{
color
:
'
#d68262
'
}
},
areaStyle
:
{
normal
:
{
color
:
new
echarts
.
graphic
.
LinearGradient
(
0
,
0
,
0
,
1
,
[{
offset
:
0
,
color
:
'
#d68262
'
},
{
offset
:
1
,
color
:
'
#ffe
'
}])
}
},
data
:
data
[
1
]
}
]
};
testHelper
.
create
(
echarts
,
'
main2
'
,
{
title
:
'
Stack on time axis (byIndex)
'
,
option
:
option
});
});
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录