Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
b1178c85
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,发现更多精彩内容 >>
提交
b1178c85
编写于
10月 09, 2014
作者:
K
kener
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dataZoom拖拽实时定位信息披露,fixed #381
showDetail
上级
0704f289
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
61 addition
and
21 deletion
+61
-21
src/component/dataZoom.js
src/component/dataZoom.js
+60
-21
src/config.js
src/config.js
+1
-0
未找到文件。
src/component/dataZoom.js
浏览文件 @
b1178c85
...
...
@@ -519,19 +519,21 @@ define(function (require) {
draggable
:
true
,
style
:
{
iconType
:
'
rectangle
'
,
x
:
this
.
_location
.
x
,
y
:
this
.
_location
.
y
,
width
:
this
.
_handleSize
,
height
:
this
.
_handleSize
,
color
:
this
.
zoomOption
.
handleColor
,
text
:
'
=
'
,
textPosition
:
'
inside
'
x
:
this
.
_location
.
x
,
y
:
this
.
_location
.
y
,
width
:
this
.
_handleSize
,
height
:
this
.
_handleSize
,
color
:
this
.
zoomOption
.
handleColor
,
text
:
'
=
'
,
textPosition
:
'
inside
'
},
highlightStyle
:
{
brushType
:
'
fill
'
highlightStyle
:
{
text
:
''
,
brushType
:
'
fill
'
,
textPosition
:
'
left
'
},
ondrift
:
this
.
_ondrift
,
ondragend
:
this
.
_ondragend
ondrift
:
this
.
_ondrift
,
ondragend
:
this
.
_ondragend
};
if
(
this
.
zoomOption
.
orient
==
'
horizontal
'
)
{
...
...
@@ -539,16 +541,17 @@ define(function (require) {
this
.
_endShape
=
zrUtil
.
clone
(
this
.
_startShape
);
this
.
_startShape
.
style
.
x
=
this
.
_fillerShae
.
style
.
x
-
this
.
_handleSize
,
this
.
_endShape
.
style
.
x
=
this
.
_fillerShae
.
style
.
x
+
this
.
_fillerShae
.
style
.
width
;
this
.
_endShape
.
style
.
x
=
this
.
_fillerShae
.
style
.
x
+
this
.
_fillerShae
.
style
.
width
;
this
.
_endShape
.
highlightStyle
.
textPosition
=
'
right
'
;
}
else
{
this
.
_startShape
.
style
.
width
=
this
.
_location
.
width
;
this
.
_endShape
=
zrUtil
.
clone
(
this
.
_startShape
);
this
.
_startShape
.
style
.
y
=
this
.
_fillerShae
.
style
.
y
-
this
.
_handleSize
;
this
.
_endShape
.
style
.
y
=
this
.
_fillerShae
.
style
.
y
+
this
.
_fillerShae
.
style
.
height
;
this
.
_startShape
.
highlightStyle
.
textPosition
=
'
top
'
;
this
.
_endShape
.
style
.
y
=
this
.
_fillerShae
.
style
.
y
+
this
.
_fillerShae
.
style
.
height
;
this
.
_endShape
.
highlightStyle
.
textPosition
=
'
bottom
'
;
}
this
.
_startShape
=
new
IconShape
(
this
.
_startShape
);
this
.
_endShape
=
new
IconShape
(
this
.
_endShape
);
...
...
@@ -588,8 +591,7 @@ define(function (require) {
_syncHandleShape
:
function
()
{
if
(
this
.
zoomOption
.
orient
==
'
horizontal
'
)
{
this
.
_startShape
.
style
.
x
=
this
.
_fillerShae
.
style
.
x
-
this
.
_handleSize
;
this
.
_endShape
.
style
.
x
=
this
.
_fillerShae
.
style
.
x
+
this
.
_fillerShae
.
style
.
width
;
this
.
_endShape
.
style
.
x
=
this
.
_fillerShae
.
style
.
x
+
this
.
_fillerShae
.
style
.
width
;
this
.
_zoom
.
start
=
Math
.
floor
(
(
this
.
_startShape
.
style
.
x
-
this
.
_location
.
x
)
...
...
@@ -602,8 +604,7 @@ define(function (require) {
}
else
{
this
.
_startShape
.
style
.
y
=
this
.
_fillerShae
.
style
.
y
-
this
.
_handleSize
;
this
.
_endShape
.
style
.
y
=
this
.
_fillerShae
.
style
.
y
+
this
.
_fillerShae
.
style
.
height
;
this
.
_endShape
.
style
.
y
=
this
.
_fillerShae
.
style
.
y
+
this
.
_fillerShae
.
style
.
height
;
this
.
_zoom
.
start
=
Math
.
floor
(
(
this
.
_startShape
.
style
.
y
-
this
.
_location
.
y
)
/
this
.
_location
.
height
*
100
...
...
@@ -613,7 +614,6 @@ define(function (require) {
/
this
.
_location
.
height
*
100
);
}
this
.
zr
.
modShape
(
this
.
_startShape
.
id
);
this
.
zr
.
modShape
(
this
.
_endShape
.
id
);
...
...
@@ -848,6 +848,32 @@ define(function (require) {
}
},
/**
* 获取当前定位
*/
_getDetail
:
function
()
{
var
key
=
this
.
zoomOption
.
orient
==
'
horizontal
'
?
'
xAxis
'
:
'
yAxis
'
;
var
target
=
this
.
_originalData
[
key
];
for
(
var
idx
in
target
)
{
var
data
=
target
[
idx
];
if
(
data
==
null
)
{
continue
;
}
var
length
=
data
.
length
;
var
start
=
Math
.
floor
(
this
.
_zoom
.
start
/
100
*
length
);
var
end
=
Math
.
ceil
(
this
.
_zoom
.
end
/
100
*
length
);
return
{
start
:
data
[
start
],
end
:
data
[
end
]
}
}
return
{
start
:
''
,
end
:
''
}
},
/**
* 拖拽范围控制
*/
...
...
@@ -886,7 +912,7 @@ define(function (require) {
shape
.
style
.
y
+=
dy
;
}
}
if
(
shape
.
_type
==
'
filler
'
)
{
this
.
_syncHandleShape
();
}
...
...
@@ -898,10 +924,23 @@ define(function (require) {
this
.
_syncData
();
}
if
(
this
.
zoomOption
.
showDetail
)
{
var
deltail
=
this
.
_getDetail
();
this
.
_startShape
.
style
.
text
=
this
.
_startShape
.
highlightStyle
.
text
=
deltail
.
start
;
this
.
_endShape
.
style
.
text
=
this
.
_endShape
.
highlightStyle
.
text
=
deltail
.
end
;
this
.
_startShape
.
style
.
textPosition
=
this
.
_startShape
.
highlightStyle
.
textPosition
;
this
.
_endShape
.
style
.
textPosition
=
this
.
_endShape
.
highlightStyle
.
textPosition
;
}
return
true
;
},
__ondragend
:
function
()
{
if
(
this
.
zoomOption
.
showDetail
)
{
this
.
_startShape
.
style
.
text
=
this
.
_endShape
.
style
.
text
=
'
=
'
;
this
.
_startShape
.
style
.
textPosition
=
this
.
_endShape
.
style
.
textPosition
=
'
inside
'
;
this
.
zr
.
modShape
(
this
.
_startShape
.
id
);
this
.
zr
.
modShape
(
this
.
_endShape
.
id
);
}
this
.
isDragend
=
true
;
},
...
...
src/config.js
浏览文件 @
b1178c85
...
...
@@ -268,6 +268,7 @@ define(function() {
dataBackgroundColor
:
'
#eee
'
,
// 数据背景颜色
fillerColor
:
'
rgba(144,197,237,0.2)
'
,
// 填充颜色
handleColor
:
'
rgba(70,130,180,0.8)
'
,
// 手柄颜色
:
true
,
// xAxisIndex: [], // 默认控制所有横向类目
// yAxisIndex: [], // 默认控制所有横向类目
// start: 0, // 默认为0
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录