Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
alon@wen
echarts
提交
a237e151
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,发现更多精彩内容 >>
提交
a237e151
编写于
8月 25, 2015
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Axis coord clamp, axis scale
上级
9acf8388
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
36 addition
and
16 deletion
+36
-16
src/chart/bar/BarSeries.js
src/chart/bar/BarSeries.js
+2
-3
src/chart/pie/PieLayout.js
src/chart/pie/PieLayout.js
+3
-0
src/component/axis.js
src/component/axis.js
+12
-5
src/coord/cartesian/Axis.js
src/coord/cartesian/Axis.js
+6
-4
src/coord/cartesian/AxisModel.js
src/coord/cartesian/AxisModel.js
+2
-2
src/coord/cartesian/Grid.js
src/coord/cartesian/Grid.js
+11
-2
未找到文件。
src/chart/bar/BarSeries.js
浏览文件 @
a237e151
...
...
@@ -8,9 +8,8 @@ define(function(require) {
type
:
'
bar
'
,
getInitialData
:
function
(
option
,
ecModel
)
{
var
list
=
List
.
fromArray
(
option
.
data
,
1
,
this
);
return
list
;
getInitialData
:
function
(
option
)
{
return
List
.
fromArray
(
option
.
data
,
1
,
this
);
},
defaultOption
:
{
...
...
src/chart/pie/PieLayout.js
0 → 100644
浏览文件 @
a237e151
define
(
function
(
require
)
{
});
\ No newline at end of file
src/component/axis.js
浏览文件 @
a237e151
...
...
@@ -79,7 +79,8 @@ define(function(require) {
lineCap
:
'
round
'
,
lineType
:
lineType
},
z
:
axisModel
.
get
(
'
z
'
)
z
:
axisModel
.
get
(
'
z
'
),
silent
:
true
}));
},
...
...
@@ -164,7 +165,9 @@ define(function(require) {
style
:
{
stroke
:
tickColor
,
lineWidth
:
tickLineWidth
}
},
silent
:
true
,
z
:
axisModel
.
get
(
'
z
'
)
});
this
.
group
.
add
(
tickEl
);
},
...
...
@@ -294,7 +297,9 @@ define(function(require) {
textBaseline
:
labelTextBaseline
},
rotation
:
labelRotate
*
Math
.
PI
/
180
,
origin
:
[
x
,
y
]
origin
:
[
x
,
y
],
silent
:
true
,
z
:
axisModel
.
get
(
'
z
'
)
});
if
(
needsCheckTextSpace
&&
!
labelRotate
)
{
...
...
@@ -387,7 +392,8 @@ define(function(require) {
lineType
:
lineType
,
lineWidth
:
lineWidth
},
silent
:
true
silent
:
true
,
z
:
axisModel
.
get
(
'
z
'
)
}));
}
},
...
...
@@ -460,7 +466,8 @@ define(function(require) {
style
:
{
fill
:
areaColors
[
i
%
areaColors
.
length
]
},
silent
:
true
silent
:
true
,
z
:
axisModel
.
get
(
'
z
'
)
}));
}
}
...
...
src/coord/cartesian/Axis.js
浏览文件 @
a237e151
...
...
@@ -57,21 +57,23 @@ define(function (require) {
/**
* Map a data to coord. Data is the rank if it has a ordinal scale
* @param {number} data
* @param {boolean} clamp
* @return {number}
*/
dataToCoord
:
function
(
data
)
{
dataToCoord
:
function
(
data
,
clamp
)
{
data
=
this
.
scale
.
normalize
(
data
);
return
linearMap
(
data
,
[
0
,
1
],
this
.
_coordExtent
);
return
linearMap
(
data
,
[
0
,
1
],
this
.
_coordExtent
,
clamp
);
},
/**
* Map a coord to data. Data is the rank if it has a ordinal scale
* @param {number} coord
* @param {boolean} clamp
* @return {number}
*/
coordToData
:
function
(
coord
)
{
var
t
=
linearMap
(
coord
,
this
.
_coordExtent
,
[
0
,
1
]);
coordToData
:
function
(
coord
,
clamp
)
{
var
t
=
linearMap
(
coord
,
this
.
_coordExtent
,
[
0
,
1
]
,
clamp
);
return
this
.
scale
.
scale
(
t
);
},
...
...
src/coord/cartesian/AxisModel.js
浏览文件 @
a237e151
...
...
@@ -7,7 +7,7 @@ define(function(require) {
valueAxis
:
{
show
:
true
,
zlevel
:
0
,
// 一级层叠
z
:
1
0
,
// 二级层叠
z
:
0
,
// 二级层叠
gridIndex
:
0
,
position
:
'
left
'
,
// 位置
name
:
''
,
// 坐标轴名字,默认为空
...
...
@@ -65,7 +65,7 @@ define(function(require) {
categoryAxis
:
{
show
:
true
,
zlevel
:
0
,
// 一级层叠
z
:
1
0
,
// 二级层叠
z
:
0
,
// 二级层叠
gridIndex
:
0
,
position
:
'
bottom
'
,
// 位置
name
:
''
,
// 坐标轴名字,默认为空
...
...
src/coord/cartesian/Grid.js
浏览文件 @
a237e151
...
...
@@ -62,6 +62,7 @@ define(function(require, factory) {
var
gridY2
=
parsePercent
(
gridModel
.
get
(
'
y2
'
),
viewportHeight
);
var
gridWidth
=
parsePercent
(
gridModel
.
get
(
'
width
'
),
viewportWidth
);
var
gridHeight
=
parsePercent
(
gridModel
.
get
(
'
height
'
),
viewportHeight
);
if
(
isNaN
(
gridWidth
))
{
gridWidth
=
viewportWidth
-
gridX2
-
gridX
;
}
...
...
@@ -123,7 +124,7 @@ define(function(require, factory) {
zrUtil
.
each
(
this
.
_axesList
,
function
(
axis
)
{
var
otherAxis
=
axis
.
otherAxis
;
if
(
axis
.
onZero
&&
otherAxis
.
type
!==
'
category
'
)
{
axis
.
otherCoord
=
otherAxis
.
dataToCoord
(
0
);
axis
.
otherCoord
=
otherAxis
.
dataToCoord
(
0
,
true
);
}
});
},
...
...
@@ -235,7 +236,9 @@ define(function(require, factory) {
axisData
=
axisDataMap
[
cartesian
.
name
]
=
{
x
:
[],
y
:
[],
cartesian
:
cartesian
cartesian
:
cartesian
,
xModel
:
ecModel
.
getComponent
(
'
xAxis
'
,
xAxisIndex
),
yModel
:
ecModel
.
getComponent
(
'
yAxis
'
,
yAxisIndex
)
};
}
...
...
@@ -264,9 +267,15 @@ define(function(require, factory) {
var
xAxis
=
cartesian
.
getAxis
(
'
x
'
);
var
yAxis
=
cartesian
.
getAxis
(
'
y
'
);
if
(
axisData
.
x
.
length
)
{
if
(
axisData
.
xModel
.
get
(
'
scale
'
))
{
axisData
.
x
.
push
(
0
);
}
xAxis
.
scale
.
setExtentFromData
(
axisData
.
x
);
}
if
(
axisData
.
y
.
length
)
{
if
(
axisData
.
yModel
.
get
(
'
scale
'
))
{
axisData
.
y
.
push
(
0
);
}
yAxis
.
scale
.
setExtentFromData
(
axisData
.
y
);
}
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录