Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
missman
incubator-echarts
提交
93eb597e
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,发现更多精彩内容 >>
提交
93eb597e
编写于
11月 29, 2015
作者:
P
pah100
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://github.com/pissang/echarts-next
上级
880a4451
b03a1c99
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
57 addition
and
15 deletion
+57
-15
src/chart/line/LineView.js
src/chart/line/LineView.js
+2
-7
src/coord/cartesian/Axis2D.js
src/coord/cartesian/Axis2D.js
+15
-0
src/coord/cartesian/AxisModel.js
src/coord/cartesian/AxisModel.js
+3
-1
src/coord/cartesian/Grid.js
src/coord/cartesian/Grid.js
+31
-1
src/coord/cartesian/GridModel.js
src/coord/cartesian/GridModel.js
+5
-5
src/util/symbol.js
src/util/symbol.js
+1
-1
未找到文件。
src/chart/line/LineView.js
浏览文件 @
93eb597e
...
...
@@ -364,13 +364,8 @@ define(function(require) {
_getSymbolIgnoreFunc
:
function
(
data
,
coordSys
)
{
var
categoryAxis
=
coordSys
.
getAxesByScale
(
'
ordinal
'
)[
0
];
// `getLabelInterval` is provided by echarts/component/axis
if
(
categoryAxis
&&
categoryAxis
.
getLabelInterval
)
{
var
labelInterval
=
categoryAxis
.
getLabelInterval
();
return
function
(
idx
)
{
return
(
typeof
labelInterval
===
'
function
'
)
&&
!
labelInterval
(
idx
,
categoryAxis
.
scale
.
getLabel
(
idx
))
||
idx
%
(
labelInterval
+
1
);
};
if
(
categoryAxis
&&
categoryAxis
.
isLabelIgnored
)
{
return
zrUtil
.
bind
(
categoryAxis
.
isLabelIgnored
,
categoryAxis
);
}
},
...
...
src/coord/cartesian/Axis2D.js
浏览文件 @
93eb597e
...
...
@@ -65,6 +65,21 @@ define(function (require) {
labelInterval
=
this
.
_labelInterval
=
axisLabelInterval
(
this
);
}
return
labelInterval
;
},
/**
* If label is ignored.
* Automatically used when axis is category and label can not be all shown
* @param {number} idx
* @return {boolean}
*/
isLabelIgnored
:
function
(
idx
)
{
if
(
this
.
type
===
'
category
'
)
{
var
labelInterval
=
this
.
getLabelInterval
();
return
((
typeof
labelInterval
===
'
function
'
)
&&
!
labelInterval
(
idx
,
this
.
scale
.
getLabel
(
idx
)))
||
idx
%
(
labelInterval
+
1
);
}
}
};
zrUtil
.
inherits
(
Axis2D
,
Axis
);
...
...
src/coord/cartesian/AxisModel.js
浏览文件 @
93eb597e
...
...
@@ -31,7 +31,9 @@ define(function(require) {
zrUtil
.
merge
(
AxisModel
.
prototype
,
require
(
'
../axisModelCommonMixin
'
));
var
extraOption
=
{
gridIndex
:
0
};
var
extraOption
=
{
gridIndex
:
0
};
axisModelCreator
(
'
x
'
,
AxisModel
,
getAxisType
,
extraOption
);
axisModelCreator
(
'
y
'
,
AxisModel
,
getAxisType
,
extraOption
);
...
...
src/coord/cartesian/Grid.js
浏览文件 @
93eb597e
...
...
@@ -30,6 +30,19 @@ define(function(require, factory) {
return
ecModel
.
getComponent
(
'
grid
'
,
axisModel
.
get
(
'
gridIndex
'
))
===
gridModel
;
}
function
getLabelUnionRect
(
axis
)
{
var
axisModel
=
axis
.
model
;
var
labels
=
axisModel
.
getFormattedLabels
();
var
rect
;
for
(
var
i
=
0
;
i
<
labels
.
length
;
i
++
)
{
if
(
!
axis
.
isLabelIgnored
(
i
))
{
var
singleRect
=
axisModel
.
getTextRect
(
labels
[
i
]);
rect
?
rect
.
union
(
singleRect
)
:
(
rect
=
singleRect
);
}
}
return
rect
;
}
function
Grid
(
gridModel
,
ecModel
,
api
)
{
/**
* @type {Object.<string, module:echarts/coord/cartesian/Cartesian2D>}
...
...
@@ -87,7 +100,24 @@ define(function(require, factory) {
this
.
_rect
=
gridRect
;
each
(
this
.
_axesList
,
function
(
axis
)
{
var
axesList
=
this
.
_axesList
;
// Minus label size
if
(
gridModel
.
get
(
'
containLabel
'
))
{
each
(
axesList
,
function
(
axis
)
{
var
labelUnionRect
=
getLabelUnionRect
(
axis
);
var
dim
=
axis
.
isHorizontal
()
?
'
height
'
:
'
width
'
;
var
margin
=
axis
.
model
.
get
(
'
axisLabel.margin
'
);
gridRect
[
dim
]
-=
labelUnionRect
[
dim
];
if
(
axis
.
isHorizontal
())
{
gridRect
.
y
+=
(
axis
.
position
===
'
top
'
?
1
:
-
1
)
*
(
labelUnionRect
.
height
+
margin
);
}
else
{
gridRect
.
x
+=
(
axis
.
position
===
'
left
'
?
1
:
-
1
)
*
(
labelUnionRect
.
width
+
margin
);
}
});
}
each
(
axesList
,
function
(
axis
)
{
var
isHorizontal
=
axis
.
isHorizontal
();
var
extent
=
isHorizontal
?
[
gridRect
.
x
,
gridRect
.
x
+
gridRect
.
width
]
...
...
src/coord/cartesian/GridModel.js
浏览文件 @
93eb597e
...
...
@@ -6,9 +6,7 @@ define(function(require) {
require
(
'
./AxisModel
'
);
var
zrUtil
=
require
(
'
zrender/core/util
'
);
var
GridModel
=
require
(
'
../../echarts
'
).
extendComponentModel
({
return
require
(
'
../../echarts
'
).
extendComponentModel
({
type
:
'
grid
'
,
...
...
@@ -23,10 +21,12 @@ define(function(require) {
show
:
false
,
zlevel
:
0
,
// 一级层叠
z
:
0
,
// 二级层叠
x
:
80
,
x
:
'
10%
'
,
y
:
60
,
x2
:
80
,
x2
:
'
10%
'
,
y2
:
60
,
// If grid size contain label
containLabel
:
false
,
// width: {totalWidth} - x - x2,
// height: {totalHeight} - y - y2,
backgroundColor
:
'
rgba(0,0,0,0)
'
,
...
...
src/util/symbol.js
浏览文件 @
93eb597e
...
...
@@ -272,7 +272,7 @@ define(function(require) {
if
(
this
.
type
!==
'
image
'
)
{
var
symbolStyle
=
this
.
style
;
var
symbolShape
=
this
.
shape
;
if
(
symbolShape
.
symbolType
===
'
line
'
)
{
if
(
symbolShape
&&
symbolShape
.
symbolType
===
'
line
'
)
{
symbolStyle
.
stroke
=
color
;
}
else
if
(
this
.
__isEmptyBrush
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录