Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
280d1827
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,发现更多精彩内容 >>
提交
280d1827
编写于
1月 06, 2016
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use coord to specify the marker's position
上级
d476554e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
36 addition
and
39 deletion
+36
-39
src/chart/lines/LinesSeries.js
src/chart/lines/LinesSeries.js
+1
-1
src/chart/map/MapSeries.js
src/chart/map/MapSeries.js
+1
-1
src/component/marker/MarkLineView.js
src/component/marker/MarkLineView.js
+7
-9
src/component/marker/MarkPointView.js
src/component/marker/MarkPointView.js
+3
-6
src/component/marker/markerHelper.js
src/component/marker/markerHelper.js
+24
-22
未找到文件。
src/chart/lines/LinesSeries.js
浏览文件 @
280d1827
...
@@ -37,7 +37,7 @@ define(function (require) {
...
@@ -37,7 +37,7 @@ define(function (require) {
var
lineData
=
new
List
([
'
value
'
],
this
);
var
lineData
=
new
List
([
'
value
'
],
this
);
function
geoCoordGetter
(
item
,
dim
,
dataIndex
,
dimIndex
)
{
function
geoCoordGetter
(
item
,
dim
,
dataIndex
,
dimIndex
)
{
return
item
.
geoCoord
&&
item
.
geoC
oord
[
dimIndex
];
return
item
.
coord
&&
item
.
c
oord
[
dimIndex
];
}
}
fromData
.
initData
(
fromDataArr
,
null
,
geoCoordGetter
);
fromData
.
initData
(
fromDataArr
,
null
,
geoCoordGetter
);
...
...
src/chart/map/MapSeries.js
浏览文件 @
280d1827
...
@@ -191,7 +191,7 @@ define(function (require) {
...
@@ -191,7 +191,7 @@ define(function (require) {
},
},
// 也是选中样式
// 也是选中样式
emphasis
:
{
emphasis
:
{
areaColor
:
'
rgba(255,215,
0,
0.8)
'
areaColor
:
'
rgba(255,215,
0,
0.8)
'
}
}
}
}
}
}
...
...
src/component/marker/MarkLineView.js
浏览文件 @
280d1827
...
@@ -18,7 +18,7 @@ define(function (require) {
...
@@ -18,7 +18,7 @@ define(function (require) {
var
mlType
=
item
.
type
;
var
mlType
=
item
.
type
;
if
(
!
zrUtil
.
isArray
(
item
)
if
(
!
zrUtil
.
isArray
(
item
)
&&
mlType
===
'
min
'
||
mlType
===
'
max
'
||
mlType
===
'
average
'
&&
mlType
===
'
min
'
||
mlType
===
'
max
'
||
mlType
===
'
average
'
)
{
)
{
if
(
item
.
valueIndex
!=
null
)
{
if
(
item
.
valueIndex
!=
null
)
{
baseAxis
=
coordSys
.
getAxis
(
coordSys
.
dimensions
[
1
-
item
.
valueIndex
]);
baseAxis
=
coordSys
.
getAxis
(
coordSys
.
dimensions
[
1
-
item
.
valueIndex
]);
valueAxis
=
coordSys
.
getAxis
(
coordSys
.
dimensions
[
item
.
valueIndex
]);
valueAxis
=
coordSys
.
getAxis
(
coordSys
.
dimensions
[
item
.
valueIndex
]);
...
@@ -48,7 +48,6 @@ define(function (require) {
...
@@ -48,7 +48,6 @@ define(function (require) {
mlFrom
[
valueAxisKey
]
=
mlTo
[
valueAxisKey
]
=
value
;
mlFrom
[
valueAxisKey
]
=
mlTo
[
valueAxisKey
]
=
value
;
item
=
[
mlFrom
,
mlTo
,
{
// Extra option for tooltip and label
item
=
[
mlFrom
,
mlTo
,
{
// Extra option for tooltip and label
__rawValue
:
value
,
type
:
mlType
type
:
mlType
}];
}];
}
}
...
@@ -81,11 +80,6 @@ define(function (require) {
...
@@ -81,11 +80,6 @@ define(function (require) {
+
((
name
?
encodeHTML
(
name
)
+
'
:
'
:
''
)
+
formattedValue
);
+
((
name
?
encodeHTML
(
name
)
+
'
:
'
:
''
)
+
formattedValue
);
},
},
getRawValue
:
function
(
idx
)
{
var
option
=
this
.
_data
.
getItemModel
(
idx
).
option
;
return
zrUtil
.
retrieve
(
option
&&
option
.
__rawValue
,
option
&&
option
.
value
,
''
);
},
getRawDataArray
:
function
()
{
getRawDataArray
:
function
()
{
return
this
.
option
.
data
;
return
this
.
option
.
data
;
},
},
...
@@ -257,10 +251,14 @@ define(function (require) {
...
@@ -257,10 +251,14 @@ define(function (require) {
zrUtil
.
curry
(
markLineFilter
,
coordSys
)
zrUtil
.
curry
(
markLineFilter
,
coordSys
)
);
);
fromData
.
initData
(
fromData
.
initData
(
zrUtil
.
map
(
optData
,
function
(
item
)
{
return
item
[
0
];
})
zrUtil
.
map
(
optData
,
function
(
item
)
{
return
item
[
0
];
}),
null
,
markerHelper
.
dimValueGetter
);
);
toData
.
initData
(
toData
.
initData
(
zrUtil
.
map
(
optData
,
function
(
item
)
{
return
item
[
1
];
})
zrUtil
.
map
(
optData
,
function
(
item
)
{
return
item
[
1
];
}),
null
,
markerHelper
.
dimValueGetter
);
);
lineData
.
initData
(
lineData
.
initData
(
zrUtil
.
map
(
optData
,
function
(
item
)
{
return
item
[
2
];
})
zrUtil
.
map
(
optData
,
function
(
item
)
{
return
item
[
2
];
})
...
...
src/component/marker/MarkPointView.js
浏览文件 @
280d1827
...
@@ -29,11 +29,6 @@ define(function (require) {
...
@@ -29,11 +29,6 @@ define(function (require) {
+
((
name
?
encodeHTML
(
name
)
+
'
:
'
:
''
)
+
formattedValue
);
+
((
name
?
encodeHTML
(
name
)
+
'
:
'
:
''
)
+
formattedValue
);
},
},
getRawValue
:
function
(
idx
)
{
var
option
=
this
.
_data
.
getItemModel
(
idx
).
option
;
return
zrUtil
.
retrieve
(
option
.
__rawValue
,
option
.
value
,
''
);
},
getData
:
function
()
{
getData
:
function
()
{
return
this
.
_data
;
return
this
.
_data
;
},
},
...
@@ -153,7 +148,9 @@ define(function (require) {
...
@@ -153,7 +148,9 @@ define(function (require) {
markerHelper
.
dataTransform
,
seriesData
,
coordSys
markerHelper
.
dataTransform
,
seriesData
,
coordSys
)),
)),
zrUtil
.
curry
(
markerHelper
.
dataFilter
,
coordSys
)
zrUtil
.
curry
(
markerHelper
.
dataFilter
,
coordSys
)
)
),
null
,
markerHelper
.
dimValueGetter
);
);
}
}
...
...
src/component/marker/markerHelper.js
浏览文件 @
280d1827
...
@@ -20,20 +20,20 @@ define(function (require) {
...
@@ -20,20 +20,20 @@ define(function (require) {
function
markerTypeCalculatorWithExtent
(
percent
,
data
,
baseAxisDim
,
valueAxisDim
,
valueIndex
)
{
function
markerTypeCalculatorWithExtent
(
percent
,
data
,
baseAxisDim
,
valueAxisDim
,
valueIndex
)
{
var
extent
=
data
.
getDataExtent
(
valueAxisDim
);
var
extent
=
data
.
getDataExtent
(
valueAxisDim
);
var
value
Arr
=
[];
var
coord
Arr
=
[];
var
min
=
extent
[
0
];
var
min
=
extent
[
0
];
var
max
=
extent
[
1
];
var
max
=
extent
[
1
];
var
val
=
(
max
-
min
)
*
percent
+
min
;
var
val
=
(
max
-
min
)
*
percent
+
min
;
var
dataIndex
=
data
.
indexOfNearest
(
valueAxisDim
,
val
);
var
dataIndex
=
data
.
indexOfNearest
(
valueAxisDim
,
val
);
value
Arr
[
1
-
valueIndex
]
=
data
.
get
(
baseAxisDim
,
dataIndex
);
coord
Arr
[
1
-
valueIndex
]
=
data
.
get
(
baseAxisDim
,
dataIndex
);
value
Arr
[
valueIndex
]
=
data
.
get
(
valueAxisDim
,
dataIndex
,
true
);
coord
Arr
[
valueIndex
]
=
data
.
get
(
valueAxisDim
,
dataIndex
,
true
);
var
precision
=
getPrecision
(
data
,
valueAxisDim
,
dataIndex
);
var
precision
=
getPrecision
(
data
,
valueAxisDim
,
dataIndex
);
if
(
precision
>=
0
)
{
if
(
precision
>=
0
)
{
valueArr
[
valueIndex
]
=
+
value
Arr
[
valueIndex
].
toFixed
(
precision
);
coordArr
[
valueIndex
]
=
+
coord
Arr
[
valueIndex
].
toFixed
(
precision
);
}
}
return
value
Arr
;
return
coord
Arr
;
}
}
var
curry
=
zrUtil
.
curry
;
var
curry
=
zrUtil
.
curry
;
...
@@ -65,7 +65,7 @@ define(function (require) {
...
@@ -65,7 +65,7 @@ define(function (require) {
/**
/**
* Transform markPoint data item to format used in List by do the following
* Transform markPoint data item to format used in List by do the following
* 1. Calculate statistic like `max`, `min`, `average`
* 1. Calculate statistic like `max`, `min`, `average`
* 2. Convert `item.xAxis`, `item.yAxis` to `item.
value
` array
* 2. Convert `item.xAxis`, `item.yAxis` to `item.
coord
` array
* @param {module:echarts/data/List} data
* @param {module:echarts/data/List} data
* @param {module:echarts/coord/*} [coordSys]
* @param {module:echarts/coord/*} [coordSys]
* @param {Object} item
* @param {Object} item
...
@@ -73,9 +73,9 @@ define(function (require) {
...
@@ -73,9 +73,9 @@ define(function (require) {
*/
*/
var
dataTransform
=
function
(
data
,
coordSys
,
item
)
{
var
dataTransform
=
function
(
data
,
coordSys
,
item
)
{
// 1. If not specify the position with pixel directly
// 1. If not specify the position with pixel directly
// 2. If
value is not a data array. Which uses xAxis, yAxis to specify the value
on each dimension
// 2. If
`coord` is not a data array. Which uses `xAxis`, `yAxis` to specify the coord
on each dimension
if
((
isNaN
(
item
.
x
)
||
isNaN
(
item
.
y
))
if
((
isNaN
(
item
.
x
)
||
isNaN
(
item
.
y
))
&&
!
zrUtil
.
isArray
(
item
.
value
)
&&
!
zrUtil
.
isArray
(
item
.
coord
)
&&
coordSys
&&
coordSys
)
{
)
{
var
valueAxisDim
;
var
valueAxisDim
;
...
@@ -101,26 +101,17 @@ define(function (require) {
...
@@ -101,26 +101,17 @@ define(function (require) {
// Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value
// Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value
item
=
zrUtil
.
extend
({},
item
);
item
=
zrUtil
.
extend
({},
item
);
if
(
item
.
type
&&
markerTypeCalculator
[
item
.
type
]
&&
baseAxis
&&
valueAxis
)
{
if
(
item
.
type
&&
markerTypeCalculator
[
item
.
type
]
&&
baseAxis
&&
valueAxis
)
{
var
value
=
markerTypeCalculator
[
item
.
type
](
item
.
coord
=
markerTypeCalculator
[
item
.
type
](
data
,
baseAxis
.
dim
,
valueAxisDim
,
valueIndex
data
,
baseAxis
.
dim
,
valueAxisDim
,
valueIndex
);
);
if
(
item
.
value
!=
null
)
{
value
.
push
(
+
item
.
value
);
}
item
.
value
=
value
;
}
}
else
{
else
{
var
originalValue
=
item
.
value
;
// FIXME Only has one of xAxis and yAxis.
// FIXME Only has one of xAxis and yAxis.
item
.
value
=
[
item
.
coord
=
[
item
.
xAxis
!=
null
?
item
.
xAxis
:
item
.
radiusAxis
,
item
.
xAxis
!=
null
?
item
.
xAxis
:
item
.
radiusAxis
,
item
.
yAxis
!=
null
?
item
.
yAxis
:
item
.
angleAxis
item
.
yAxis
!=
null
?
item
.
yAxis
:
item
.
angleAxis
];
];
if
(
originalValue
!=
null
)
{
item
.
value
.
push
(
+
originalValue
);
}
}
}
item
.
__rawValue
=
item
.
value
[
valueIndex
];
}
}
return
item
;
return
item
;
};
};
...
@@ -135,12 +126,23 @@ define(function (require) {
...
@@ -135,12 +126,23 @@ define(function (require) {
*/
*/
var
dataFilter
=
function
(
coordSys
,
item
)
{
var
dataFilter
=
function
(
coordSys
,
item
)
{
// Alwalys return true if there is no coordSys
// Alwalys return true if there is no coordSys
return
(
coordSys
&&
item
.
value
&&
(
item
.
x
==
null
||
item
.
y
==
null
))
return
(
coordSys
&&
item
.
coord
&&
(
item
.
x
==
null
||
item
.
y
==
null
))
?
coordSys
.
containData
(
item
.
value
)
:
true
;
?
coordSys
.
containData
(
item
.
coord
)
:
true
;
};
var
dimValueGetter
=
function
(
item
,
dimName
,
dataIndex
,
dimIndex
)
{
// x, y, radius, angle
if
(
dimIndex
<
2
)
{
return
item
.
coord
&&
item
.
coord
[
dimIndex
];
}
else
{
item
.
value
;
}
};
};
return
{
return
{
dataTransform
:
dataTransform
,
dataTransform
:
dataTransform
,
dataFilter
:
dataFilter
dataFilter
:
dataFilter
,
dimValueGetter
:
dimValueGetter
};
};
});
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录