Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
missman
incubator-echarts
提交
a394304b
I
incubator-echarts
项目概览
missman
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
a394304b
编写于
11月 29, 2015
作者:
P
pah100
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://github.com/pissang/echarts-next
上级
dc2a0461
9598a6e7
变更
60
展开全部
隐藏空白更改
内联
并排
Showing
60 changed file
with
147 addition
and
87 deletion
+147
-87
map/js/province/anhui.js
map/js/province/anhui.js
+0
-0
map/js/province/fujian.js
map/js/province/fujian.js
+0
-0
map/js/province/gansu.js
map/js/province/gansu.js
+0
-0
map/js/province/guangdong.js
map/js/province/guangdong.js
+0
-0
map/js/province/guangxi.js
map/js/province/guangxi.js
+0
-0
map/js/province/guizhou.js
map/js/province/guizhou.js
+0
-0
map/js/province/hainan.js
map/js/province/hainan.js
+0
-0
map/js/province/hebei.js
map/js/province/hebei.js
+0
-0
map/js/province/heilongjiang.js
map/js/province/heilongjiang.js
+0
-0
map/js/province/henan.js
map/js/province/henan.js
+0
-0
map/js/province/hubei.js
map/js/province/hubei.js
+0
-0
map/js/province/hunan.js
map/js/province/hunan.js
+0
-0
map/js/province/jiangsu.js
map/js/province/jiangsu.js
+0
-0
map/js/province/jiangxi.js
map/js/province/jiangxi.js
+0
-0
map/js/province/jilin.js
map/js/province/jilin.js
+0
-0
map/js/province/liaoning.js
map/js/province/liaoning.js
+0
-0
map/js/province/neimenggu.js
map/js/province/neimenggu.js
+0
-0
map/js/province/ningxia.js
map/js/province/ningxia.js
+0
-0
map/js/province/qinghai.js
map/js/province/qinghai.js
+0
-0
map/js/province/shandong.js
map/js/province/shandong.js
+0
-0
map/js/province/shanxi.js
map/js/province/shanxi.js
+0
-0
map/js/province/sichuan.js
map/js/province/sichuan.js
+0
-0
map/js/province/xicang.js
map/js/province/xicang.js
+0
-0
map/js/province/xinjiang.js
map/js/province/xinjiang.js
+0
-0
map/js/province/yunnan.js
map/js/province/yunnan.js
+0
-0
map/js/province/zhejiang.js
map/js/province/zhejiang.js
+0
-0
map/json/province/anhui.json
map/json/province/anhui.json
+0
-0
map/json/province/fujian.json
map/json/province/fujian.json
+0
-0
map/json/province/gansu.json
map/json/province/gansu.json
+0
-0
map/json/province/guangdong.json
map/json/province/guangdong.json
+0
-0
map/json/province/guangxi.json
map/json/province/guangxi.json
+0
-0
map/json/province/guizhou.json
map/json/province/guizhou.json
+0
-0
map/json/province/hainan.json
map/json/province/hainan.json
+0
-0
map/json/province/hebei.json
map/json/province/hebei.json
+0
-0
map/json/province/heilongjiang.json
map/json/province/heilongjiang.json
+0
-0
map/json/province/henan.json
map/json/province/henan.json
+0
-0
map/json/province/hubei.json
map/json/province/hubei.json
+0
-0
map/json/province/hunan.json
map/json/province/hunan.json
+0
-0
map/json/province/jiangsu.json
map/json/province/jiangsu.json
+0
-0
map/json/province/jiangxi.json
map/json/province/jiangxi.json
+0
-0
map/json/province/jilin.json
map/json/province/jilin.json
+0
-0
map/json/province/liaoning.json
map/json/province/liaoning.json
+0
-0
map/json/province/neimenggu.json
map/json/province/neimenggu.json
+0
-0
map/json/province/ningxia.json
map/json/province/ningxia.json
+0
-0
map/json/province/qinghai.json
map/json/province/qinghai.json
+0
-0
map/json/province/shandong.json
map/json/province/shandong.json
+0
-0
map/json/province/shanxi.json
map/json/province/shanxi.json
+0
-0
map/json/province/sichuan.json
map/json/province/sichuan.json
+0
-0
map/json/province/xicang.json
map/json/province/xicang.json
+0
-0
map/json/province/xinjiang.json
map/json/province/xinjiang.json
+0
-0
map/json/province/yunnan.json
map/json/province/yunnan.json
+0
-0
map/json/province/zhejiang.json
map/json/province/zhejiang.json
+0
-0
src/chart/helper/createListFromArray.js
src/chart/helper/createListFromArray.js
+2
-2
src/chart/line/LineSeries.js
src/chart/line/LineSeries.js
+3
-0
src/chart/line/LineView.js
src/chart/line/LineView.js
+16
-4
src/component/legend/LegendView.js
src/component/legend/LegendView.js
+6
-0
src/component/tooltip.js
src/component/tooltip.js
+102
-73
src/component/tooltip/TooltipModel.js
src/component/tooltip/TooltipModel.js
+3
-0
src/util/graphic.js
src/util/graphic.js
+8
-8
test/area2.html
test/area2.html
+7
-0
未找到文件。
map/js/anhui.js
→
map/js/
province/
anhui.js
浏览文件 @
a394304b
文件已移动
map/js/fujian.js
→
map/js/
province/
fujian.js
浏览文件 @
a394304b
文件已移动
map/js/gansu.js
→
map/js/
province/
gansu.js
浏览文件 @
a394304b
文件已移动
map/js/guangdong.js
→
map/js/
province/
guangdong.js
浏览文件 @
a394304b
文件已移动
map/js/guangxi.js
→
map/js/
province/
guangxi.js
浏览文件 @
a394304b
文件已移动
map/js/guizhou.js
→
map/js/
province/
guizhou.js
浏览文件 @
a394304b
文件已移动
map/js/hainan.js
→
map/js/
province/
hainan.js
浏览文件 @
a394304b
文件已移动
map/js/hebei.js
→
map/js/
province/
hebei.js
浏览文件 @
a394304b
文件已移动
map/js/heilongjiang.js
→
map/js/
province/
heilongjiang.js
浏览文件 @
a394304b
文件已移动
map/js/henan.js
→
map/js/
province/
henan.js
浏览文件 @
a394304b
文件已移动
map/js/hubei.js
→
map/js/
province/
hubei.js
浏览文件 @
a394304b
文件已移动
map/js/hunan.js
→
map/js/
province/
hunan.js
浏览文件 @
a394304b
文件已移动
map/js/jiangsu.js
→
map/js/
province/
jiangsu.js
浏览文件 @
a394304b
文件已移动
map/js/jiangxi.js
→
map/js/
province/
jiangxi.js
浏览文件 @
a394304b
文件已移动
map/js/jilin.js
→
map/js/
province/
jilin.js
浏览文件 @
a394304b
文件已移动
map/js/liaoning.js
→
map/js/
province/
liaoning.js
浏览文件 @
a394304b
文件已移动
map/js/neimenggu.js
→
map/js/
province/
neimenggu.js
浏览文件 @
a394304b
文件已移动
map/js/ningxia.js
→
map/js/
province/
ningxia.js
浏览文件 @
a394304b
文件已移动
map/js/qinghai.js
→
map/js/
province/
qinghai.js
浏览文件 @
a394304b
文件已移动
map/js/shandong.js
→
map/js/
province/
shandong.js
浏览文件 @
a394304b
文件已移动
map/js/shanxi.js
→
map/js/
province/
shanxi.js
浏览文件 @
a394304b
文件已移动
map/js/sichuan.js
→
map/js/
province/
sichuan.js
浏览文件 @
a394304b
文件已移动
map/js/xicang.js
→
map/js/
province/
xicang.js
浏览文件 @
a394304b
文件已移动
map/js/xinjiang.js
→
map/js/
province/
xinjiang.js
浏览文件 @
a394304b
文件已移动
map/js/yunnan.js
→
map/js/
province/
yunnan.js
浏览文件 @
a394304b
文件已移动
map/js/zhejiang.js
→
map/js/
province/
zhejiang.js
浏览文件 @
a394304b
文件已移动
map/json/anhui.json
→
map/json/
province/
anhui.json
浏览文件 @
a394304b
文件已移动
map/json/fujian.json
→
map/json/
province/
fujian.json
浏览文件 @
a394304b
文件已移动
map/json/gansu.json
→
map/json/
province/
gansu.json
浏览文件 @
a394304b
文件已移动
map/json/guangdong.json
→
map/json/
province/
guangdong.json
浏览文件 @
a394304b
文件已移动
map/json/guangxi.json
→
map/json/
province/
guangxi.json
浏览文件 @
a394304b
文件已移动
map/json/guizhou.json
→
map/json/
province/
guizhou.json
浏览文件 @
a394304b
文件已移动
map/json/hainan.json
→
map/json/
province/
hainan.json
浏览文件 @
a394304b
文件已移动
map/json/hebei.json
→
map/json/
province/
hebei.json
浏览文件 @
a394304b
文件已移动
map/json/heilongjiang.json
→
map/json/
province/
heilongjiang.json
浏览文件 @
a394304b
文件已移动
map/json/henan.json
→
map/json/
province/
henan.json
浏览文件 @
a394304b
文件已移动
map/json/hubei.json
→
map/json/
province/
hubei.json
浏览文件 @
a394304b
文件已移动
map/json/hunan.json
→
map/json/
province/
hunan.json
浏览文件 @
a394304b
文件已移动
map/json/jiangsu.json
→
map/json/
province/
jiangsu.json
浏览文件 @
a394304b
文件已移动
map/json/jiangxi.json
→
map/json/
province/
jiangxi.json
浏览文件 @
a394304b
文件已移动
map/json/jilin.json
→
map/json/
province/
jilin.json
浏览文件 @
a394304b
文件已移动
map/json/liaoning.json
→
map/json/
province/
liaoning.json
浏览文件 @
a394304b
文件已移动
map/json/neimenggu.json
→
map/json/
province/
neimenggu.json
浏览文件 @
a394304b
文件已移动
map/json/ningxia.json
→
map/json/
province/
ningxia.json
浏览文件 @
a394304b
文件已移动
map/json/qinghai.json
→
map/json/
province/
qinghai.json
浏览文件 @
a394304b
文件已移动
map/json/shandong.json
→
map/json/
province/
shandong.json
浏览文件 @
a394304b
文件已移动
map/json/shanxi.json
→
map/json/
province/
shanxi.json
浏览文件 @
a394304b
文件已移动
map/json/sichuan.json
→
map/json/
province/
sichuan.json
浏览文件 @
a394304b
文件已移动
map/json/xicang.json
→
map/json/
province/
xicang.json
浏览文件 @
a394304b
文件已移动
map/json/xinjiang.json
→
map/json/
province/
xinjiang.json
浏览文件 @
a394304b
文件已移动
map/json/yunnan.json
→
map/json/
province/
yunnan.json
浏览文件 @
a394304b
文件已移动
map/json/zhejiang.json
→
map/json/
province/
zhejiang.json
浏览文件 @
a394304b
文件已移动
src/chart/helper/createListFromArray.js
浏览文件 @
a394304b
...
...
@@ -45,7 +45,7 @@ define(function(require) {
},
{
name
:
'
y
'
,
// If two category axes
type
:
isYAxisCategory
?
'
ordinal
'
:
'
number
'
,
type
:
isYAxisCategory
?
'
ordinal
'
:
'
float
'
,
stackable
:
!
isYAxisCategory
}];
...
...
@@ -92,7 +92,7 @@ define(function(require) {
},
{
name
:
'
radius
'
,
// If two category axes
type
:
isRadiusAxisCategory
?
'
ordinal
'
:
'
number
'
,
type
:
isRadiusAxisCategory
?
'
ordinal
'
:
'
float
'
,
stackable
:
!
isRadiusAxisCategory
}];
...
...
src/chart/line/LineSeries.js
浏览文件 @
a394304b
...
...
@@ -67,6 +67,9 @@ define(function(require) {
symbolSize
:
4
,
// 拐点图形旋转控制
// symbolRotate: null,
// 不显示 symbol, 只有在 tooltip hover 的时候显示
// notShowSymbol: false,
// 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略)
// showAllSymbol: false
...
...
src/chart/line/LineView.js
浏览文件 @
a394304b
...
...
@@ -127,7 +127,9 @@ define(function(require) {
var
isAreaChart
=
!
areaStyleModel
.
isEmpty
();
var
stackedOnPoints
=
getStackedOnPoints
(
coordSys
,
data
);
var
isSymbolIgnore
=
!
isCoordSysPolar
&&
!
seriesModel
.
get
(
'
showAllSymbol
'
)
var
showSymbol
=
!
seriesModel
.
get
(
'
notShowSymbol
'
);
var
isSymbolIgnore
=
showSymbol
&&
!
isCoordSysPolar
&&
!
seriesModel
.
get
(
'
showAllSymbol
'
)
&&
this
.
_getSymbolIgnoreFunc
(
data
,
coordSys
);
// Remove temporary symbols
...
...
@@ -139,12 +141,18 @@ define(function(require) {
}
});
// Remove previous created symbols if notShowSymbol changed to true
if
(
!
showSymbol
)
{
symbolDraw
.
remove
();
}
// Initialization animation or coordinate system changed
if
(
!
(
polyline
&&
prevCoordSys
.
type
===
coordSys
.
type
)
)
{
symbolDraw
.
updateData
(
data
,
isSymbolIgnore
);
showSymbol
&&
symbolDraw
.
updateData
(
data
,
isSymbolIgnore
);
polyline
=
this
.
_newPolyline
(
group
,
points
,
coordSys
,
hasAnimation
);
if
(
isAreaChart
)
{
polygon
=
this
.
_newPolygon
(
...
...
@@ -165,8 +173,9 @@ define(function(require) {
);
}
// Always update, or it is wrong in the case turning on legend because points is not changed
symbolDraw
.
updateData
(
data
,
isSymbolIgnore
);
// Always update, or it is wrong in the case turning on legend
// because points are not changed
showSymbol
&&
symbolDraw
.
updateData
(
data
,
isSymbolIgnore
);
// Stop symbol animation and sync with line points
// FIXME performance?
...
...
@@ -258,6 +267,9 @@ define(function(require) {
symbol
.
__temp
=
true
;
data
.
setItemGraphicEl
(
dataIndex
,
symbol
);
// Stop scale animation;
symbol
.
childAt
(
0
).
stopAnimation
(
true
);
this
.
group
.
add
(
symbol
);
}
symbol
.
highlight
();
...
...
src/component/legend/LegendView.js
浏览文件 @
a394304b
...
...
@@ -243,6 +243,12 @@ define(function (require) {
});
itemGroup
.
add
(
text
);
// Add a invisible rect to increase the area of mouse hover
itemGroup
.
add
(
new
graphic
.
Rect
({
shape
:
itemGroup
.
getBoundingRect
(),
invisible
:
true
}));
itemGroup
.
eachChild
(
function
(
child
)
{
child
.
silent
=
!
selectMode
;
});
...
...
src/component/tooltip.js
浏览文件 @
a394304b
...
...
@@ -91,7 +91,7 @@ define(function (require) {
return
tpl
;
}
function
adjusted
TooltipPosition
(
x
,
y
,
el
,
viewWidth
,
viewHeight
)
{
function
refix
TooltipPosition
(
x
,
y
,
el
,
viewWidth
,
viewHeight
)
{
var
width
=
el
.
clientWidth
;
var
height
=
el
.
clientHeight
;
var
gap
=
20
;
...
...
@@ -111,6 +111,78 @@ define(function (require) {
return
[
x
,
y
];
}
function
calcTooltipPosition
(
position
,
rect
,
dom
)
{
var
domWidth
=
dom
.
clientWidth
;
var
domHeight
=
dom
.
clientHeight
;
var
gap
=
5
;
var
x
=
0
;
var
y
=
0
;
var
rectWidth
=
rect
.
width
;
var
rectHeight
=
rect
.
height
;
switch
(
position
)
{
case
'
top
'
:
x
=
rect
.
x
+
rectWidth
/
2
-
domWidth
/
2
;
y
=
rect
.
y
-
domHeight
-
gap
;
break
;
case
'
bottom
'
:
x
=
rect
.
x
+
rectWidth
/
2
-
domWidth
/
2
;
y
=
rect
.
y
+
rectHeight
+
gap
;
break
;
case
'
left
'
:
x
=
rect
.
x
-
domWidth
-
gap
;
y
=
rect
.
y
+
rectHeight
/
2
-
domHeight
/
2
;
break
;
case
'
right
'
:
x
=
rect
.
x
+
rectWidth
+
gap
;
y
=
rect
.
y
+
rectHeight
/
2
-
domHeight
/
2
;
}
return
[
x
,
y
];
}
/**
* @param {string|Function|Array.<number>} positionExpr
* @param {number} x Mouse x
* @param {number} y Mouse y
* @param {module:echarts/component/tooltip/TooltipContent} content
* @param {Object|<Array.<Object>} params
* @param {module:zrender/Element} el target element
* @param {module:echarts/ExtensionAPI} api
* @return {Array.<number>}
*/
function
updatePosition
(
positionExpr
,
x
,
y
,
content
,
params
,
el
,
api
)
{
var
viewWidth
=
api
.
getWidth
();
var
viewHeight
=
api
.
getHeight
();
var
rect
=
el
&&
el
.
getBoundingRect
().
clone
();
el
&&
el
.
transform
&&
rect
.
applyTransform
(
el
.
transform
);
if
(
typeof
positionExpr
===
'
function
'
)
{
// Callback of position can be an array or a string specify the positiont
var
positionExpr
=
positionExpr
([
x
,
y
],
params
,
rect
);
}
if
(
zrUtil
.
isArray
(
positionExpr
))
{
x
=
parsePercent
(
positionExpr
[
0
],
viewWidth
);
y
=
parsePercent
(
positionExpr
[
1
],
viewHeight
);
}
// Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element
else
if
(
typeof
positionExpr
===
'
string
'
&&
el
)
{
var
pos
=
calcTooltipPosition
(
positionExpr
,
rect
,
content
.
el
);
x
=
pos
[
0
];
y
=
pos
[
1
];
}
else
{
var
pos
=
refixTooltipPosition
(
x
,
y
,
content
.
el
,
viewWidth
,
viewHeight
);
x
=
pos
[
0
];
y
=
pos
[
1
];
}
content
.
moveTo
(
x
,
y
);
}
require
(
'
../echarts
'
).
extendComponentView
({
type
:
'
tooltip
'
,
...
...
@@ -417,9 +489,9 @@ define(function (require) {
cartesian
,
axisPointerModel
,
axisType
,
targetShape
);
moveAnimation
?
pointerEl
.
animateTo
(
{
?
graphic
.
updateProps
(
pointerEl
,
{
shape
:
targetShape
},
200
,
'
cubicOut
'
)
},
axisPointerModel
)
:
pointerEl
.
attr
({
shape
:
targetShape
});
...
...
@@ -440,9 +512,9 @@ define(function (require) {
cartesian
,
axisPointerModel
,
axisType
,
targetShape
);
moveAnimation
?
pointerEl
.
animateTo
(
{
?
graphic
.
updateProps
(
pointerEl
,
{
shape
:
targetShape
},
200
,
'
cubicOut
'
)
},
axisPointerModel
)
:
pointerEl
.
attr
({
shape
:
targetShape
});
...
...
@@ -506,9 +578,9 @@ define(function (require) {
);
moveAnimation
?
pointerEl
.
animateTo
(
{
?
graphic
.
updateProps
(
pointerEl
,
{
shape
:
targetShape
},
200
,
'
cubicOut
'
)
},
axisPointerModel
)
:
pointerEl
.
attr
({
shape
:
targetShape
});
...
...
@@ -549,9 +621,9 @@ define(function (require) {
polar
,
axisPointerModel
,
axisType
,
targetShape
);
moveAnimation
?
pointerEl
.
animateTo
(
{
?
graphic
.
updateProps
(
pointerEl
,
{
shape
:
targetShape
},
200
,
'
cubicOut
'
)
},
axisPointerModel
)
:
pointerEl
.
attr
({
shape
:
targetShape
});
...
...
@@ -658,6 +730,8 @@ define(function (require) {
var
val
=
value
[
baseAxis
.
dim
===
'
x
'
?
0
:
1
];
var
dataIndex
=
data
.
indexOfNearest
(
baseAxis
.
dim
,
val
);
var
api
=
this
.
_api
;
// FIXME Not here
var
lastHover
=
this
.
_lastHover
;
if
(
lastHover
.
seriesIndex
!=
null
&&
!
contentNotChange
)
{
...
...
@@ -684,7 +758,7 @@ define(function (require) {
if
(
baseAxis
&&
rootTooltipModel
.
get
(
'
showContent
'
))
{
var
formatter
=
rootTooltipModel
.
get
(
'
formatter
'
);
var
position
Func
=
rootTooltipModel
.
get
(
'
position
'
);
var
position
Expr
=
rootTooltipModel
.
get
(
'
position
'
);
var
html
;
var
paramsList
=
zrUtil
.
map
(
seriesList
,
function
(
series
)
{
...
...
@@ -720,14 +794,10 @@ define(function (require) {
if
(
cbTicket
===
self
.
_ticket
)
{
tooltipContent
.
setContent
(
html
);
if
(
!
positionFunc
)
{
var
pos
=
adjustedTooltipPosition
(
point
[
0
],
point
[
1
],
tooltipContent
.
el
,
viewWidth
,
viewHeight
);
x
=
pos
[
0
];
y
=
pos
[
1
];
tooltipContent
.
moveTo
(
x
,
y
);
}
updatePosition
(
positionExpr
,
point
[
0
],
point
[
1
],
tooltipContent
,
paramsList
,
null
,
api
);
}
};
self
.
_ticket
=
ticket
;
...
...
@@ -738,29 +808,10 @@ define(function (require) {
tooltipContent
.
setContent
(
html
);
}
var
api
=
this
.
_api
;
var
viewWidth
=
api
.
getWidth
();
var
viewHeight
=
api
.
getHeight
();
var
x
=
point
[
0
];
var
y
=
point
[
1
];
if
(
typeof
positionFunc
===
'
function
'
)
{
var
pos
=
positionFunc
([
x
,
y
],
paramsList
);
x
=
parsePercent
(
pos
[
0
],
viewWidth
);
y
=
parsePercent
(
pos
[
1
],
viewHeight
);
}
else
if
(
zrUtil
.
isArray
(
positionFunc
))
{
x
=
parsePercent
(
positionFunc
[
0
],
viewWidth
);
y
=
parsePercent
(
positionFunc
[
1
],
viewHeight
);
}
else
{
var
pos
=
adjustedTooltipPosition
(
x
,
y
,
tooltipContent
.
el
,
viewWidth
,
viewHeight
);
x
=
pos
[
0
];
y
=
pos
[
1
];
}
tooltipContent
.
moveTo
(
x
,
y
);
updatePosition
(
positionExpr
,
point
[
0
],
point
[
1
],
tooltipContent
,
paramsList
,
null
,
api
);
}
},
...
...
@@ -792,7 +843,7 @@ define(function (require) {
if
(
tooltipModel
.
get
(
'
showContent
'
))
{
var
formatter
=
tooltipModel
.
get
(
'
formatter
'
);
var
position
Func
=
tooltipModel
.
get
(
'
position
'
);
var
position
Expr
=
tooltipModel
.
get
(
'
position
'
);
var
params
=
seriesModel
.
getDataParams
(
dataIndex
);
var
html
;
if
(
!
formatter
)
{
...
...
@@ -808,14 +859,11 @@ define(function (require) {
var
callback
=
function
(
cbTicket
,
html
)
{
if
(
cbTicket
===
self
.
_ticket
)
{
tooltipContent
.
setContent
(
html
);
if
(
!
positionFunc
)
{
var
pos
=
adjustedTooltipPosition
(
e
.
offsetX
,
e
.
offsetY
,
tooltipContent
.
el
,
viewWidth
,
viewHeight
);
x
=
pos
[
0
];
y
=
pos
[
1
];
tooltipContent
.
moveTo
(
x
,
y
);
}
updatePosition
(
positionExpr
,
e
.
offsetX
,
e
.
offsetY
,
tooltipContent
,
params
,
e
.
target
,
api
);
}
};
self
.
_ticket
=
ticket
;
...
...
@@ -826,29 +874,10 @@ define(function (require) {
tooltipContent
.
show
(
tooltipModel
);
tooltipContent
.
setContent
(
html
);
var
x
=
e
.
offsetX
;
var
y
=
e
.
offsetY
;
var
viewWidth
=
api
.
getWidth
();
var
viewHeight
=
api
.
getHeight
();
if
(
typeof
positionFunc
===
'
function
'
)
{
var
pos
=
positionFunc
([
x
,
y
],
params
);
x
=
parsePercent
(
pos
[
0
],
viewWidth
);
y
=
parsePercent
(
pos
[
1
],
viewHeight
);
}
else
if
(
zrUtil
.
isArray
(
positionFunc
))
{
x
=
parsePercent
(
positionFunc
[
0
],
viewWidth
);
y
=
parsePercent
(
positionFunc
[
1
],
viewHeight
);
}
else
{
var
pos
=
adjustedTooltipPosition
(
x
,
y
,
tooltipContent
.
el
,
viewWidth
,
viewHeight
);
x
=
pos
[
0
];
y
=
pos
[
1
];
}
tooltipContent
.
moveTo
(
x
,
y
);
updatePosition
(
positionExpr
,
e
.
offsetX
,
e
.
offsetY
,
tooltipContent
,
params
,
e
.
target
,
api
);
}
},
...
...
src/component/tooltip/TooltipModel.js
浏览文件 @
a394304b
...
...
@@ -69,6 +69,9 @@ define(function (require) {
// 极坐标系会默认选择 angle 轴
axis
:
'
auto
'
,
animation
:
true
,
animationDurationUpdate
:
200
,
// 直线指示器样式设置
lineStyle
:
{
color
:
'
#555
'
,
...
...
src/util/graphic.js
浏览文件 @
a394304b
...
...
@@ -318,14 +318,14 @@ define(function(require) {
});
};
function
animateOrSetProps
(
isUpdate
,
el
,
props
,
series
Model
,
cb
)
{
function
animateOrSetProps
(
isUpdate
,
el
,
props
,
animatable
Model
,
cb
)
{
var
postfix
=
isUpdate
?
'
Update
'
:
''
;
var
duration
=
series
Model
&&
series
Model
.
getShallow
(
'
animationDuration
'
+
postfix
);
var
animationEasing
=
series
Model
&&
series
Model
.
getShallow
(
'
animationEasing
'
+
postfix
);
var
duration
=
animatable
Model
&&
animatable
Model
.
getShallow
(
'
animationDuration
'
+
postfix
);
var
animationEasing
=
animatable
Model
&&
animatable
Model
.
getShallow
(
'
animationEasing
'
+
postfix
);
seriesModel
&&
series
Model
.
getShallow
(
'
animation
'
)
animatableModel
&&
animatable
Model
.
getShallow
(
'
animation
'
)
?
el
.
animateTo
(
props
,
duration
,
animationEasing
,
cb
)
:
(
el
.
attr
(
props
),
cb
&&
cb
());
}
...
...
@@ -333,7 +333,7 @@ define(function(require) {
* Update graphic element properties with or without animation according to the configuration in series
* @param {module:zrender/Element} el
* @param {Object} props
* @param {module:echarts/model/
Series} [series
Model]
* @param {module:echarts/model/
Model} [animatable
Model]
* @param {Function} cb
*/
graphic
.
updateProps
=
zrUtil
.
curry
(
animateOrSetProps
,
true
);
...
...
@@ -342,7 +342,7 @@ define(function(require) {
* Init graphic element properties with or without animation according to the configuration in series
* @param {module:zrender/Element} el
* @param {Object} props
* @param {module:echarts/model/
Series} [series
Model]
* @param {module:echarts/model/
Model} [animatable
Model]
* @param {Function} cb
*/
graphic
.
initProps
=
zrUtil
.
curry
(
animateOrSetProps
,
false
);
...
...
test/area2.html
浏览文件 @
a394304b
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录