Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
alon@wen
echarts
提交
ec08c772
E
echarts
项目概览
alon@wen
/
echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ec08c772
编写于
9月 11, 2015
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Value, coord and point
上级
2ea759a6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
13 deletion
+33
-13
src/coord/cartesian/Cartesian2D.js
src/coord/cartesian/Cartesian2D.js
+2
-2
src/coord/polar/Polar.js
src/coord/polar/Polar.js
+31
-11
未找到文件。
src/coord/cartesian/Cartesian2D.js
浏览文件 @
ec08c772
...
...
@@ -15,7 +15,7 @@ define(function(require) {
type
:
'
cartesian2d
'
,
/**
* If contain
coord
* If contain
point
*/
containPoint
:
function
(
x
,
y
)
{
return
this
.
getAxis
(
'
x
'
).
contain
(
x
)
...
...
@@ -23,7 +23,7 @@ define(function(require) {
},
/**
* Convert series data to
coorindate
s
* Convert series data to
a list of point
s
* @param {module:echarts/data/List} data
* @return {Array}
* Return list of coordinates. For example:
...
...
src/coord/polar/Polar.js
浏览文件 @
ec08c772
...
...
@@ -51,6 +51,15 @@ define(function(require) {
type
:
'
polar
'
,
/**
* If contain coord
*/
containPoint
:
function
(
point
)
{
var
coord
=
this
.
pointToCoord
(
point
);
return
this
.
_radiusAxis
.
contain
(
coord
[
0
])
&&
this
.
_angleAxis
.
contain
(
coord
[
1
]);
},
/**
* @return {module:echarts/coord/polar/AngleAxis}
*/
...
...
@@ -66,7 +75,7 @@ define(function(require) {
},
/**
* Convert series data to a list of
coorindate
s
* Convert series data to a list of
(x, y) point
s
* @param {module:echarts/data/List} data
* @return {Array}
* Return list of coordinates. For example:
...
...
@@ -79,7 +88,7 @@ define(function(require) {
},
/**
* Convert a single data item to
coordinate
.
* Convert a single data item to
(x, y) point
.
* Parameter data is an array which the first element is radius and the second is angle
* @param {Array.<number>} data
* @return {Array.<number>}
...
...
@@ -95,13 +104,27 @@ define(function(require) {
},
/**
* Convert a coord to data
* @param {Array.<number>} coord
* Convert a (x, y) point to data
* @param {Array.<number>} point
* @return {Array.<number>}
*/
pointToData
:
function
(
point
)
{
var
coord
=
this
.
pointToCoord
(
point
);
return
[
this
.
_radiusAxis
.
radiusToData
(
coord
[
0
]),
this
.
_angleAxis
.
angleToData
(
coord
[
1
])
/
Math
.
PI
*
180
];
},
/**
* Convert a (x, y) point to (radius, angle) coord
* @param {Array.<number>} point
* @return {Array.<number>}
*/
pointTo
Data
:
function
(
coord
)
{
var
dx
=
coord
[
0
]
-
this
.
cx
;
var
dy
=
coord
[
1
]
-
this
.
cy
;
pointTo
Coord
:
function
(
point
)
{
var
dx
=
point
[
0
]
-
this
.
cx
;
var
dy
=
point
[
1
]
-
this
.
cy
;
var
radius
=
Math
.
sqrt
(
dx
*
dx
+
dy
*
dy
);
dx
/=
radius
;
...
...
@@ -109,10 +132,7 @@ define(function(require) {
var
angle
=
Math
.
atan2
(
dy
,
dx
);
return
[
this
.
_radiusAxis
.
radiusToData
(
radius
),
this
.
_angleAxis
.
angleToData
(
angle
)
/
Math
.
PI
*
180
];
return
[
radius
,
angle
];
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录