Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
半栈学徒
incubator-echarts
提交
6b10351b
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,发现更多精彩内容 >>
提交
6b10351b
编写于
1月 17, 2018
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[timeline] Fix #7506 (next button and prev button can not be disabled).
上级
801fc009
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
119 addition
and
23 deletion
+119
-23
src/component/timeline/SliderTimelineView.js
src/component/timeline/SliderTimelineView.js
+1
-2
src/preprocessor/helper/compatStyle.js
src/preprocessor/helper/compatStyle.js
+10
-3
test/pie.html
test/pie.html
+45
-6
test/timeline-finance.html
test/timeline-finance.html
+5
-3
test/tooltip-setOption.html
test/tooltip-setOption.html
+58
-9
未找到文件。
src/component/timeline/SliderTimelineView.js
浏览文件 @
6b10351b
...
...
@@ -147,7 +147,7 @@ export default TimelineView.extend({
var
mainLength
=
orient
===
'
vertical
'
?
viewRect
.
height
:
viewRect
.
width
;
var
controlModel
=
timelineModel
.
getModel
(
'
controlStyle
'
);
var
showControl
=
controlModel
.
get
(
'
show
'
);
var
showControl
=
controlModel
.
get
(
'
show
'
,
true
);
var
controlSize
=
showControl
?
controlModel
.
get
(
'
itemSize
'
)
:
0
;
var
controlGap
=
showControl
?
controlModel
.
get
(
'
itemGap
'
)
:
0
;
var
sizePlusGap
=
controlSize
+
controlGap
;
...
...
@@ -161,7 +161,6 @@ export default TimelineView.extend({
var
nextBtnPosition
;
var
axisExtent
;
var
controlPosition
=
controlModel
.
get
(
'
position
'
,
true
);
var
showControl
=
controlModel
.
get
(
'
show
'
,
true
);
var
showPlayBtn
=
showControl
&&
controlModel
.
get
(
'
showPlayBtn
'
,
true
);
var
showPrevBtn
=
showControl
&&
controlModel
.
get
(
'
showPrevBtn
'
,
true
);
var
showNextBtn
=
showControl
&&
controlModel
.
get
(
'
showNextBtn
'
,
true
);
...
...
src/preprocessor/helper/compatStyle.js
浏览文件 @
6b10351b
...
...
@@ -41,13 +41,20 @@ function compatEC2ItemStyle(opt) {
}
}
function
convertNormalEmphasis
(
opt
,
optType
)
{
function
convertNormalEmphasis
(
opt
,
optType
,
useExtend
)
{
if
(
opt
&&
opt
[
optType
]
&&
(
opt
[
optType
].
normal
||
opt
[
optType
].
emphasis
))
{
var
normalOpt
=
opt
[
optType
].
normal
;
var
emphasisOpt
=
opt
[
optType
].
emphasis
;
if
(
normalOpt
)
{
opt
[
optType
]
=
normalOpt
;
// Timeline controlStyle has other properties besides normal and emphasis
if
(
useExtend
)
{
opt
[
optType
].
normal
=
opt
[
optType
].
emphasis
=
null
;
zrUtil
.
defaults
(
opt
[
optType
],
normalOpt
);
}
else
{
opt
[
optType
]
=
normalOpt
;
}
}
if
(
emphasisOpt
)
{
opt
.
emphasis
=
opt
.
emphasis
||
{};
...
...
@@ -246,7 +253,7 @@ export default function (option, isTheme) {
compatEC3CommonStyles
(
timelineOpt
);
convertNormalEmphasis
(
timelineOpt
,
'
label
'
);
convertNormalEmphasis
(
timelineOpt
,
'
itemStyle
'
);
convertNormalEmphasis
(
timelineOpt
,
'
controlStyle
'
);
convertNormalEmphasis
(
timelineOpt
,
'
controlStyle
'
,
true
);
convertNormalEmphasis
(
timelineOpt
,
'
checkpointStyle
'
);
var
data
=
timelineOpt
.
data
;
...
...
test/pie.html
浏览文件 @
6b10351b
...
...
@@ -5,17 +5,17 @@
<script
src=
"lib/config.js"
></script>
<script
src=
"data/pie-texture.js"
></script>
<script
src=
"lib/dat.gui.min.js"
></script>
<link
rel=
"stylesheet"
href=
"lib/reset.css"
/>
<script
src=
"lib/testHelper.js"
></script>
</head>
<body>
<style>
html
,
body
,
#main
{
width
:
100%
;
height
:
100%
;
/* background-image: url(old_mathematics.png); */
/* background-repeat: repeat; */
}
</style>
<div
id=
"main"
></div>
<div
id=
"main2"
></div>
<script>
var
chart
;
require
([
...
...
@@ -296,5 +296,44 @@
})
</script>
<script>
require
([
'
echarts
'
],
function
(
echarts
)
{
var
option
=
{
legend
:
{},
dataset
:
{
source
:
[
{
name
:
'
a
'
,
value
:
123
},
{
name
:
'
b
'
,
value
:
456
},
{
name
:
'
should be selected
'
,
value
:
789
,
selected
:
true
}
]
},
series
:
{
type
:
'
pie
'
,
selectedMode
:
'
multiply
'
}
};
testHelper
.
create
(
echarts
,
'
main2
'
,
{
option
:
option
,
info
:
option
})
});
</script>
</body>
</html>
\ No newline at end of file
test/timeline-finance.html
浏览文件 @
6b10351b
...
...
@@ -66,9 +66,11 @@ var option = {
autoPlay
:
true
,
// currentIndex: 2,
playInterval
:
1000
,
// controlStyle: {
// position: 'left'
// },
controlStyle
:
{
showNextBtn
:
false
,
showPrevBtn
:
false
,
position
:
'
left
'
},
data
:
[
'
2002-01-01
'
,
'
2003-01-01
'
,
'
2004-01-01
'
,
{
...
...
test/tooltip-setOption.html
浏览文件 @
6b10351b
...
...
@@ -29,9 +29,12 @@
<div><a
target=
"_blank"
href=
"dynamicData2.html"
>
dynamicData2.html
</a></div>
<div><a
target=
"_blank"
href=
"dynamicData3.html"
>
dynamicData3.html
</a></div>
<h1>
triggerOn click setOption when trigger axis (keep show)
</h1>
<div
class=
"chart"
id=
"click-setOption1"
></div>
<h1>
triggerOn click setOption when trigger item (keep show)
</h1>
<div
class=
"chart"
id=
"click-setOption2"
></div>
<!-- <div class="chart" id="click-setOption1"></div> -->
<h1>
tooltip should auto show and auto disappear when setOption(..., {notMerge: true})
</h1>
<div
class=
"chart"
id=
"setOption2"
>
</div>
...
...
@@ -98,14 +101,60 @@
var
chart
=
createChart
(
'
click-setOption1
'
,
echarts
,
option
,
baseTop
);
window
.
ecClickSetOptionAxisChart
=
chart
;
})
</script>
chart
.
on
(
'
showTip
'
,
function
(
params
)
{
console
.
log
(
'
asdf
'
,
params
);
chart
.
setOption
({
// tooltip: {}
<script>
require
([
'
echarts
'
],
function
(
echarts
)
{
function
genOption
()
{
return
{
tooltip
:
{
trigger
:
'
axis
'
,
axisPointer
:
{
type
:
'
cross
'
}
},
xAxis
:
{},
yAxis
:
{},
series
:
[{
type
:
'
scatter
'
,
data
:
[
[
Math
.
random
(),
Math
.
random
()
*
100
],
[
Math
.
random
(),
Math
.
random
()
*
100
],
[
Math
.
random
(),
Math
.
random
()
*
100
]
]
}]
};
}
var
chart
=
echarts
.
init
(
document
.
getElementById
(
'
setOption2
'
));
chart
.
setOption
(
genOption
());
setTimeout
(
function
()
{
chart
.
dispatchAction
({
type
:
'
showTip
'
,
seriesIndex
:
0
,
dataIndex
:
0
});
});
})
setTimeout
(
function
()
{
// chart.clear();
chart
.
dispose
();
chart
=
echarts
.
init
(
document
.
getElementById
(
'
setOption2
'
));
chart
.
setOption
(
genOption
());
},
2000
)
},
100
);
});
</script>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录