Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
alon@wen
echarts
提交
b1299aa2
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,发现更多精彩内容 >>
提交
b1299aa2
编写于
2月 21, 2016
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Optimize legend layout. Legend and Toolbox support width and height configuration. Fix #2621
上级
3e0a3f31
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
31 addition
and
13 deletion
+31
-13
src/component/helper/listComponent.js
src/component/helper/listComponent.js
+6
-2
src/component/legend/LegendModel.js
src/component/legend/LegendModel.js
+3
-1
src/component/toolbox/ToolboxModel.js
src/component/toolbox/ToolboxModel.js
+1
-1
src/coord/single/SingleAxis.js
src/coord/single/SingleAxis.js
+10
-9
src/util/layout.js
src/util/layout.js
+11
-0
未找到文件。
src/component/helper/listComponent.js
浏览文件 @
b1299aa2
...
...
@@ -24,12 +24,16 @@ define(function (require) {
* @param {module:echarts/ExtensionAPI}
*/
layout
:
function
(
group
,
componentModel
,
api
)
{
var
rect
=
layout
.
getLayoutRect
(
componentModel
.
getBoxLayoutParams
(),
{
width
:
api
.
getWidth
(),
height
:
api
.
getHeight
()
},
componentModel
.
get
(
'
padding
'
));
layout
.
box
(
componentModel
.
get
(
'
orient
'
),
group
,
componentModel
.
get
(
'
itemGap
'
),
api
.
getWidth
()
,
api
.
getHeight
()
rect
.
width
,
rect
.
height
);
positionGroup
(
group
,
componentModel
,
api
);
...
...
src/component/legend/LegendModel.js
浏览文件 @
b1299aa2
...
...
@@ -11,7 +11,9 @@ define(function(require) {
dependencies
:
[
'
series
'
],
layoutMode
:
{
type
:
'
box
'
,
ignoreSize
:
true
},
layoutMode
:
{
type
:
'
box
'
},
init
:
function
(
option
,
parentModel
,
ecModel
)
{
this
.
mergeDefaultAndTheme
(
option
,
ecModel
);
...
...
src/component/toolbox/ToolboxModel.js
浏览文件 @
b1299aa2
...
...
@@ -7,7 +7,7 @@ define(function (require) {
type
:
'
toolbox
'
,
layoutMode
:
{
type
:
'
box
'
,
ignoreSize
:
true
},
layoutMode
:
{
type
:
'
box
'
},
mergeDefaultAndTheme
:
function
(
option
)
{
this
.
$superApply
(
'
mergeDefaultAndTheme
'
,
arguments
);
...
...
src/coord/single/SingleAxis.js
浏览文件 @
b1299aa2
...
...
@@ -34,7 +34,7 @@ define(function (require) {
* - 'left'
* - 'right'
* @type {string}
*/
*/
this
.
position
=
position
||
'
bottom
'
;
/**
...
...
@@ -49,7 +49,7 @@ define(function (require) {
* @type {number}
*/
this
.
_labelInterval
=
null
;
};
SingleAxis
.
prototype
=
{
...
...
@@ -64,7 +64,7 @@ define(function (require) {
/**
* Judge the orient of the axis.
* @return {boolean}
* @return {boolean}
*/
isHorizontal
:
function
()
{
var
position
=
this
.
position
;
...
...
@@ -74,7 +74,7 @@ define(function (require) {
/**
* Get interval of the axis label.
* @return {number}
* @return {number}
*/
getLabelInterval
:
function
()
{
var
labelInterval
=
this
.
_labelInterval
;
...
...
@@ -89,16 +89,17 @@ define(function (require) {
}
labelInterval
=
this
.
_labelInterval
=
axisHelper
.
getAxisLabelInterval
(
zrUtil
.
map
(
this
.
scale
.
getTicks
(),
this
.
dataToCoord
,
this
),
axisModel
.
getFormattedLabels
(),
labelModel
.
getModel
(
'
textStyle
'
).
getFont
(),
this
.
isHorizontal
());
zrUtil
.
map
(
this
.
scale
.
getTicks
(),
this
.
dataToCoord
,
this
),
axisModel
.
getFormattedLabels
(),
labelModel
.
getModel
(
'
textStyle
'
).
getFont
(),
this
.
isHorizontal
()
);
}
return
labelInterval
;
},
/**
* Convert the local coord(processed by dataToCoord())
* Convert the local coord(processed by dataToCoord())
* to global coord(concrete pixel coord).
* designated by module:echarts/coord/single/Single.
* @type {Function}
...
...
src/util/layout.js
浏览文件 @
b1299aa2
...
...
@@ -227,6 +227,17 @@ define(function(require) {
top
=
containerHeight
-
height
-
verticalMargin
;
break
;
}
// If something is wrong and left, top, width, height are calculated as NaN
left
=
left
||
0
;
top
=
top
||
0
;
if
(
isNaN
(
width
))
{
// Width may be NaN if only one value is given except width
width
=
containerWidth
-
left
-
(
right
||
0
);
}
if
(
isNaN
(
height
))
{
// Height may be NaN if only one value is given except height
height
=
containerHeight
-
top
-
(
bottom
||
0
);
}
var
rect
=
new
BoundingRect
(
left
+
margin
[
3
],
top
+
margin
[
0
],
width
,
height
);
rect
.
margin
=
margin
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录