Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
31243cdf
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,发现更多精彩内容 >>
提交
31243cdf
编写于
11月 02, 2017
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix dataZoom action error when only use one param of 'start' or 'end'.
上级
81291279
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
214 addition
and
12 deletion
+214
-12
src/component/dataZoom/DataZoomModel.js
src/component/dataZoom/DataZoomModel.js
+20
-6
test/dataZoom-action.html
test/dataZoom-action.html
+190
-0
test/lib/requireES.js
test/lib/requireES.js
+4
-6
未找到文件。
src/component/dataZoom/DataZoomModel.js
浏览文件 @
31243cdf
...
@@ -433,12 +433,8 @@ var DataZoomModel = echarts.extendComponentModel({
...
@@ -433,12 +433,8 @@ var DataZoomModel = echarts.extendComponentModel({
* @param {boolean} [ignoreUpdateRangeUsg=false]
* @param {boolean} [ignoreUpdateRangeUsg=false]
*/
*/
setRawRange
:
function
(
opt
,
ignoreUpdateRangeUsg
)
{
setRawRange
:
function
(
opt
,
ignoreUpdateRangeUsg
)
{
each
([
'
start
'
,
'
end
'
,
'
startValue
'
,
'
endValue
'
],
function
(
name
)
{
setOneSide
(
opt
,
this
.
option
,
'
start
'
);
// If any of those prop is null/undefined, we should alos set
setOneSide
(
opt
,
this
.
option
,
'
end
'
);
// them, because only one pair between start/end and
// startValue/endValue can work.
this
.
option
[
name
]
=
opt
[
name
];
},
this
);
!
ignoreUpdateRangeUsg
&&
updateRangeUse
(
this
,
opt
);
!
ignoreUpdateRangeUsg
&&
updateRangeUse
(
this
,
opt
);
},
},
...
@@ -514,6 +510,24 @@ var DataZoomModel = echarts.extendComponentModel({
...
@@ -514,6 +510,24 @@ var DataZoomModel = echarts.extendComponentModel({
});
});
// percentName: 'start' or 'end', valueName: 'startValue' or 'endValue'
function
setOneSide
(
inputParams
,
option
,
percentName
)
{
var
names
=
[
percentName
,
percentName
+
'
Value
'
];
var
hasValueIdx
;
each
(
names
,
function
(
name
,
index
)
{
if
(
inputParams
[
name
]
!=
null
)
{
option
[
name
]
=
inputParams
[
name
];
hasValueIdx
=
index
;
}
});
// If only 'start' or 'startValue' is set in inputParams and then assigned
// to option, the other one should be cleared in option. because only one
// pair between start/end and startValue/endValue can work.
if
(
hasValueIdx
!=
null
)
{
option
[
names
[
1
-
hasValueIdx
]]
=
null
;
}
}
function
retrieveRaw
(
option
)
{
function
retrieveRaw
(
option
)
{
var
ret
=
{};
var
ret
=
{};
each
(
each
(
...
...
test/dataZoom-action.html
0 → 100644
浏览文件 @
31243cdf
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
/>
<script
src=
"../dist/echarts.js"
></script>
<script
src=
"lib/facePrint.js"
></script>
<script
src=
"lib/jquery.min.js"
></script>
<link
rel=
"stylesheet"
href=
"reset.css"
/>
</head>
<body>
<style>
h1
{
line-height
:
60px
;
background
:
#360
;
text-align
:
center
;
font-weight
:
bold
;
color
:
#eee
;
font-size
:
14px
;
margin
:
0
;
}
.chart
{
height
:
450px
;
}
.by-dispatch-action
{
padding
:
5px
;
}
</style>
<div
class=
"by-dispatch-action"
>
by dispatchAction:
<button
id=
"change-start-value"
>
Change Start Value
</button>
<button
id=
"change-end-value"
>
Change Start Value
</button>
<button
id=
"first-focus"
>
First Focus
</button>
</div>
<div
id=
"main"
>
<div
class=
"chart"
id=
"chart"
></div>
</div>
<script>
$
.
getJSON
(
'
./data/ec-star.json
'
,
function
(
data
)
{
$
(
'
#first-focus
'
).
on
(
'
click
'
,
firstFocus
);
$
(
'
#change-start-value
'
).
on
(
'
click
'
,
changeStartValue
);
$
(
'
#change-end-value
'
).
on
(
'
click
'
,
changeEndValue
);
var
myChart
=
echarts
.
init
(
document
.
getElementById
(
'
chart
'
));
var
minStartValue
=
'
2013-06-06
'
;
var
maxEndValue
=
'
2017-10-17
'
;
var
currStartValue
=
'
2017-01-01
'
;
var
currEndValue
=
maxEndValue
;
var
option
=
{
animationDurationUpdate
:
3000
,
tooltip
:
{
trigger
:
'
axis
'
},
xAxis
:
[{
type
:
'
time
'
,
boundaryGap
:
false
,
axisLabel
:{
textStyle
:{
fontSize
:
14
}
},
splitLine
:
{
show
:
false
,
lineStyle
:{
color
:
'
#f7f7f7
'
}
}
}],
yAxis
:
[{
type
:
'
value
'
,
name
:
'
Github Star
'
,
nameGap
:
30
,
nameTextStyle
:
{
fontSize
:
20
},
axisLabel
:
{
fontSize
:
15
},
splitLine
:
{
show
:
true
,
lineStyle
:{
color
:
'
#f7f7f7
'
}
}
}],
grid
:
{
top
:
120
,
left
:
30
,
right
:
30
,
bottom
:
50
,
containLabel
:
true
},
dataZoom
:
[{
id
:
'
dz
'
,
type
:
'
inside
'
,
xAxisIndex
:
0
,
startValue
:
currStartValue
,
endValue
:
currEndValue
,
minValueSpan
:
3600
*
24
*
1000
*
10
},
{
type
:
'
slider
'
,
xAxisIndex
:
0
,
startValue
:
currStartValue
,
endValue
:
currEndValue
,
height
:
20
,
handleIcon
:
'
M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z
'
,
handleSize
:
'
90%
'
,
minSpanValue
:
3600
*
24
*
1000
*
10
}],
visualMap
:
{
show
:
false
,
type
:
'
continuous
'
,
seriesIndex
:
0
,
min
:
0
,
max
:
23000
},
series
:
[{
type
:
'
line
'
,
name
:
'
Star
'
,
lineStyle
:
{
normal
:
{
width
:
4
}
},
itemStyle
:
{
normal
:
{
borderColor
:
'
#fff
'
,
borderWidth
:
2
}
},
showSymbol
:
false
,
symbol
:
'
circle
'
,
hoverAnimation
:
false
,
symbolSize
:
15
,
sampling
:
'
average
'
,
// smooth: true,
// symbol: 'none',
data
:
data
}]
};
myChart
.
setOption
(
option
);
$
(
window
).
resize
(
function
()
{
myChart
.
resize
();
})
// Control -------------------------
function
changeStartValue
(
phase
)
{
currStartValue
=
'
2014-09-01
'
;
myChart
.
dispatchAction
({
type
:
'
dataZoom
'
,
id
:
'
dz
'
,
startValue
:
currStartValue
});
}
function
changeEndValue
(
phase
)
{
currEndValue
=
'
2017-02-05
'
;
myChart
.
dispatchAction
({
type
:
'
dataZoom
'
,
id
:
'
dz
'
,
endValue
:
currEndValue
});
}
function
firstFocus
(
phase
)
{
currStartValue
=
minStartValue
;
currEndValue
=
'
2013-11-06
'
;
myChart
.
dispatchAction
({
type
:
'
dataZoom
'
,
id
:
'
dz
'
,
startValue
:
currStartValue
,
endValue
:
currEndValue
});
}
});
</script>
</body>
</html>
\ No newline at end of file
test/lib/requireES.js
浏览文件 @
31243cdf
...
@@ -26,13 +26,11 @@
...
@@ -26,13 +26,11 @@
*
*
* [Caution]:
* [Caution]:
*
*
* 1) Modules are not shared between different
* 1) Modules are not shared between different calling of `requireES(...)`.
* calling of `simpleModuleLoader.load()`.
*
*
* 2) Whether import `*` or `default` is determined
* 2) Whether import `*` or `default` is determined by the module itself.
* by module itself. That is, if the module only
* That is, if the module (like `xxx/SomeClz`) only export `default` , it
* export `default` (like `xxx/SomeClz`), we import
* imports `default`, otherwise (like `xxx/util`) it imports `*`.
* `default`, otherwise import `*` (like `xxx/util`).
*/
*/
/* global define, ActiveXObject */
/* global define, ActiveXObject */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录