Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
35465f14
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,发现更多精彩内容 >>
提交
35465f14
编写于
1月 14, 2014
作者:
K
kener
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
文本换行支持
上级
47148ffc
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
72 addition
and
60 deletion
+72
-60
doc/doc.html
doc/doc.html
+5
-6
src/chart/force.js
src/chart/force.js
+2
-2
src/chart/pie.js
src/chart/pie.js
+2
-2
src/component/categoryAxis.js
src/component/categoryAxis.js
+6
-1
src/component/dataRange.js
src/component/dataRange.js
+48
-40
src/component/title.js
src/component/title.js
+2
-2
src/component/toolbox.js
src/component/toolbox.js
+7
-7
未找到文件。
doc/doc.html
浏览文件 @
35465f14
...
...
@@ -735,7 +735,7 @@ require(['echarts'], function(ec){
<tr>
<td>
{string} text
</td>
<td>
''
</td>
<td>
主标题文本
</td>
<td>
主标题文本
,'\n'指定换行
</td>
</tr>
<tr>
<td>
{string} link
</td>
...
...
@@ -745,7 +745,7 @@ require(['echarts'], function(ec){
<tr>
<td>
{string} subtext
</td>
<td>
''
</td>
<td>
副标题文本
</td>
<td>
副标题文本
,'\n'指定换行
</td>
</tr>
<tr>
<td>
{string} sublink
</td>
...
...
@@ -990,7 +990,7 @@ require(['echarts'], function(ec){
<tr>
<td>
{Array} text
</td>
<td>
null
</td>
<td>
值域文字显示,splitNumber生效时默认以计算所得数值作为值域文字显示,可指定长度为2的文本数组显示简介的值域文本,如['高', '低']
</td>
<td>
值域文字显示,splitNumber生效时默认以计算所得数值作为值域文字显示,可指定长度为2的文本数组显示简介的值域文本,如['高', '低']
,'\n'指定换行
</td>
</tr>
<tr>
<td>
{Object} textStyle
</td>
...
...
@@ -1763,8 +1763,7 @@ feature : {
</table>
<h5>
axis.data
<a
name=
"AxisData"
>
</a></h5>
<P>
类目型坐标轴文本标签数组,指定label内容。
数组项通常为文本,如:
</P>
<P>
类目型坐标轴文本标签数组,指定label内容。 数组项通常为文本,'\n'指定换行,如:
</P>
<div
class=
"code"
>
<pre>
[
'
Jan
'
,
'
Feb
'
,
'
Mar
'
,
'
Apr
'
,
'
May
'
,
'
Jun
'
, ...,
'
Dec
'
]
</pre>
...
...
@@ -2721,7 +2720,7 @@ geoCoord : {
<tr>
<td>
{string} text
</td>
<td>
'Loading...'
</td>
<td>
显示话术
</td>
<td>
显示话术
,'\n'指定换行
</td>
</tr>
<tr>
<td>
{string | number} x
</td>
...
...
src/chart/force.js
浏览文件 @
35465f14
...
...
@@ -294,7 +294,7 @@ define(function(require) {
)
||
{};
shape
.
style
.
textColor
=
labelStyle
.
color
||
'
#fff
'
;
shape
.
style
.
textAlign
=
labelStyle
.
align
||
'
center
'
;
shape
.
style
.
textBase
L
ine
=
labelStyle
.
baseline
||
'
middle
'
;
shape
.
style
.
textBase
l
ine
=
labelStyle
.
baseline
||
'
middle
'
;
shape
.
style
.
textFont
=
self
.
getFont
(
labelStyle
);
}
...
...
@@ -307,7 +307,7 @@ define(function(require) {
shape
.
highlightStyle
.
textColor
=
labelStyle
.
color
||
'
#fff
'
;
shape
.
highlightStyle
.
textAlign
=
labelStyle
.
align
||
'
center
'
;
shape
.
highlightStyle
.
textBase
L
ine
=
labelStyle
.
baseline
shape
.
highlightStyle
.
textBase
l
ine
=
labelStyle
.
baseline
||
'
middle
'
;
shape
.
highlightStyle
.
textFont
=
self
.
getFont
(
labelStyle
);
}
...
...
src/chart/pie.js
浏览文件 @
35465f14
...
...
@@ -332,7 +332,7 @@ define(function(require) {
queryTarget
,
'
itemStyle.normal.label.textStyle.align
'
)
||
'
center
'
;
sector
.
style
.
textBase
L
ine
=
self
.
deepQuery
(
sector
.
style
.
textBase
l
ine
=
self
.
deepQuery
(
queryTarget
,
'
itemStyle.normal.label.textStyle.baseline
'
)
||
'
middle
'
;
...
...
@@ -370,7 +370,7 @@ define(function(require) {
queryTarget
,
'
itemStyle.emphasis.label.textStyle.align
'
)
||
'
center
'
;
sector
.
highlightStyle
.
textBase
L
ine
=
self
.
deepQuery
(
sector
.
highlightStyle
.
textBase
l
ine
=
self
.
deepQuery
(
queryTarget
,
'
itemStyle.normal.label.textStyle.baseline
'
)
||
'
middle
'
;
...
...
src/component/categoryAxis.js
浏览文件 @
35465f14
...
...
@@ -668,7 +668,12 @@ define(function (require) {
// 根据类目轴数据索引换算类目轴名称
function
getNameByIndex
(
dataIndex
)
{
return
option
.
data
[
dataIndex
];
if
(
typeof
option
.
data
[
dataIndex
].
value
!=
'
undefined
'
)
{
return
option
.
data
[
dataIndex
].
value
;
}
else
{
return
option
.
data
[
dataIndex
];
}
}
// 根据类目轴数据索引换算类目轴名称
...
...
src/component/dataRange.js
浏览文件 @
35465f14
...
...
@@ -81,7 +81,7 @@ define(function (require) {
var
itemWidth
=
dataRangeOption
.
itemWidth
;
var
itemHeight
=
dataRangeOption
.
itemHeight
;
var
itemGap
=
dataRangeOption
.
itemGap
;
var
textHeight
=
zrArea
.
getText
Width
(
'
国
'
,
font
);
var
textHeight
=
zrArea
.
getText
Height
(
'
国
'
,
font
);
var
color
;
if
(
dataRangeOption
.
orient
==
'
vertical
'
...
...
@@ -108,6 +108,8 @@ define(function (require) {
}
else
{
lastY
+=
textHeight
+
_textGap
;
textShape
.
style
.
y
+=
textHeight
/
2
+
_textGap
;
textShape
.
style
.
textBaseline
=
'
bottom
'
;
}
self
.
shapeList
.
push
(
textShape
);
}
...
...
@@ -178,6 +180,11 @@ define(function (require) {
textShape
=
_getTextShape
(
lastX
,
lastY
,
dataRangeOption
.
text
[
1
]
);
if
(
dataRangeOption
.
orient
!=
'
horizontal
'
)
{
textShape
.
style
.
y
-=
5
;
textShape
.
style
.
textBaseline
=
'
top
'
;
}
self
.
shapeList
.
push
(
textShape
);
}
...
...
@@ -195,7 +202,7 @@ define(function (require) {
var
lastY
=
_itemGroupLocation
.
y
;
var
itemWidth
=
dataRangeOption
.
itemWidth
;
var
itemHeight
=
dataRangeOption
.
itemHeight
;
var
textHeight
=
zrArea
.
getText
Width
(
'
国
'
,
font
);
var
textHeight
=
zrArea
.
getText
Height
(
'
国
'
,
font
);
var
needValueText
=
true
;
...
...
@@ -215,6 +222,8 @@ define(function (require) {
}
else
{
lastY
+=
textHeight
+
_textGap
;
textShape
.
style
.
y
+=
textHeight
/
2
+
_textGap
;
textShape
.
style
.
textBaseline
=
'
bottom
'
;
}
self
.
shapeList
.
push
(
textShape
);
}
...
...
@@ -313,7 +322,7 @@ define(function (require) {
var
height
=
_calculableLocation
.
height
;
var
font
=
self
.
getFont
(
dataRangeOption
.
textStyle
);
var
textH
ieght
=
zrArea
.
getTextWidth
(
'
国
'
,
font
)
+
2
;
var
textH
eight
=
zrArea
.
getTextHeight
(
'
国
'
,
font
)
;
var
textWidth
=
Math
.
max
(
zrArea
.
getTextWidth
(
dataRangeOption
.
precision
===
0
...
...
@@ -344,23 +353,23 @@ define(function (require) {
// 手柄统统在下方
pointListStart
=
[
[
x
,
y
],
[
x
,
y
+
height
+
textH
ie
ght
/
2
*
3
],
[
x
-
textWidth
,
y
+
height
+
textH
ie
ght
/
2
*
3
],
[
x
-
textWidth
,
y
+
height
+
textH
ie
ght
/
2
],
[
x
-
textH
ieght
/
2
,
y
+
height
+
textHie
ght
/
2
],
[
x
,
y
+
height
+
textH
ei
ght
/
2
*
3
],
[
x
-
textWidth
,
y
+
height
+
textH
ei
ght
/
2
*
3
],
[
x
-
textWidth
,
y
+
height
+
textH
ei
ght
/
2
],
[
x
-
textH
eight
/
2
,
y
+
height
+
textHei
ght
/
2
],
[
x
-
1
,
y
+
height
],
[
x
-
1
,
y
]
];
textXStart
=
x
-
textWidth
/
2
;
textYStart
=
y
+
height
+
textH
ie
ght
;
textYStart
=
y
+
height
+
textH
ei
ght
;
pointListEnd
=
[
[
x
+
width
,
y
],
[
x
+
width
,
y
+
height
+
textH
ie
ght
/
2
*
3
],
[
x
+
width
+
textWidth
,
y
+
height
+
textH
ie
ght
/
2
*
3
],
[
x
+
width
+
textWidth
,
y
+
height
+
textH
ie
ght
/
2
],
[
x
+
width
+
textH
ieght
/
2
,
y
+
height
+
textHie
ght
/
2
],
[
x
+
width
,
y
+
height
+
textH
ei
ght
/
2
*
3
],
[
x
+
width
+
textWidth
,
y
+
height
+
textH
ei
ght
/
2
*
3
],
[
x
+
width
+
textWidth
,
y
+
height
+
textH
ei
ght
/
2
],
[
x
+
width
+
textH
eight
/
2
,
y
+
height
+
textHei
ght
/
2
],
[
x
+
width
+
1
,
y
+
height
],
[
x
+
width
+
1
,
y
]
];
...
...
@@ -371,23 +380,23 @@ define(function (require) {
// 手柄在上方
pointListStart
=
[
[
x
,
y
+
height
],
[
x
,
y
-
textH
ie
ght
/
2
*
3
],
[
x
-
textWidth
,
y
-
textH
ie
ght
/
2
*
3
],
[
x
-
textWidth
,
y
-
textH
ie
ght
/
2
],
[
x
-
textH
ieght
/
2
,
y
-
textHie
ght
/
2
],
[
x
,
y
-
textH
ei
ght
/
2
*
3
],
[
x
-
textWidth
,
y
-
textH
ei
ght
/
2
*
3
],
[
x
-
textWidth
,
y
-
textH
ei
ght
/
2
],
[
x
-
textH
eight
/
2
,
y
-
textHei
ght
/
2
],
[
x
-
1
,
y
],
[
x
-
1
,
y
+
height
]
];
textXStart
=
x
-
textWidth
/
2
;
textYStart
=
y
-
textH
ie
ght
;
textYStart
=
y
-
textH
ei
ght
;
pointListEnd
=
[
[
x
+
width
,
y
+
height
],
[
x
+
width
,
y
-
textH
ie
ght
/
2
*
3
],
[
x
+
width
+
textWidth
,
y
-
textH
ie
ght
/
2
*
3
],
[
x
+
width
+
textWidth
,
y
-
textH
ie
ght
/
2
],
[
x
+
width
+
textH
ieght
/
2
,
y
-
textHie
ght
/
2
],
[
x
+
width
,
y
-
textH
ei
ght
/
2
*
3
],
[
x
+
width
+
textWidth
,
y
-
textH
ei
ght
/
2
*
3
],
[
x
+
width
+
textWidth
,
y
-
textH
ei
ght
/
2
],
[
x
+
width
+
textH
eight
/
2
,
y
-
textHei
ght
/
2
],
[
x
+
width
+
1
,
y
],
[
x
+
width
+
1
,
y
+
height
]
];
...
...
@@ -396,55 +405,54 @@ define(function (require) {
}
}
else
{
textWidth
+=
textH
ie
ght
;
textWidth
+=
textH
ei
ght
;
// 垂直
if
(
dataRangeOption
.
x
!=
'
right
'
)
{
// 手柄统统在右侧
pointListStart
=
[
[
x
,
y
],
[
x
+
width
+
textWidth
,
y
],
[
x
+
width
+
textWidth
,
y
-
textH
ie
ght
],
[
x
+
width
+
textH
ieght
,
y
-
textHie
ght
],
[
x
+
width
+
textWidth
,
y
-
textH
ei
ght
],
[
x
+
width
+
textH
eight
,
y
-
textHei
ght
],
[
x
+
width
,
y
-
1
],
[
x
,
y
-
1
]
];
textXStart
=
x
+
width
+
textWidth
/
2
+
textHieght
/
2
;
textYStart
=
y
-
textHieght
/
2
;
textXStart
=
x
+
width
+
textWidth
/
2
+
textHeight
/
2
;
textYStart
=
y
-
textHeight
/
2
;
pointListEnd
=
[
[
x
,
y
+
height
],
[
x
+
width
+
textWidth
,
y
+
height
],
[
x
+
width
+
textWidth
,
y
+
textH
ie
ght
+
height
],
[
x
+
width
+
textH
ieght
,
y
+
textHie
ght
+
height
],
[
x
+
width
+
textWidth
,
y
+
textH
ei
ght
+
height
],
[
x
+
width
+
textH
eight
,
y
+
textHei
ght
+
height
],
[
x
+
width
,
y
+
1
+
height
],
[
x
,
y
+
height
+
1
]
];
textXEnd
=
textXStart
;
textYEnd
=
y
+
height
+
textH
ie
ght
/
2
;
textYEnd
=
y
+
height
+
textH
ei
ght
/
2
;
}
else
{
// 手柄在左侧
pointListStart
=
[
[
x
+
width
,
y
],
[
x
-
textWidth
,
y
],
[
x
-
textWidth
,
y
-
textH
ie
ght
],
[
x
-
textH
ieght
,
y
-
textHie
ght
],
[
x
-
textWidth
,
y
-
textH
ei
ght
],
[
x
-
textH
eight
,
y
-
textHei
ght
],
[
x
,
y
-
1
],
[
x
+
width
,
y
-
1
]
];
textXStart
=
x
-
textWidth
/
2
-
textH
ie
ght
/
2
;
textYStart
=
y
-
textH
ie
ght
/
2
;
textXStart
=
x
-
textWidth
/
2
-
textH
ei
ght
/
2
;
textYStart
=
y
-
textH
ei
ght
/
2
;
pointListEnd
=
[
[
x
+
width
,
y
+
height
],
[
x
-
textWidth
,
y
+
height
],
[
x
-
textWidth
,
y
+
textH
ie
ght
+
height
],
[
x
-
textH
ieght
,
y
+
textHie
ght
+
height
],
[
x
-
textWidth
,
y
+
textH
ei
ght
+
height
],
[
x
-
textH
eight
,
y
+
textHei
ght
+
height
],
[
x
,
y
+
1
+
height
],
[
x
+
width
,
y
+
height
+
1
]
];
textXEnd
=
textXStart
;
textYEnd
=
y
+
height
+
textH
ie
ght
/
2
;
textYEnd
=
y
+
height
+
textH
ei
ght
/
2
;
}
}
...
...
@@ -458,7 +466,7 @@ define(function (require) {
textY
:
textYStart
,
textPosition
:
'
specific
'
,
textAlign
:
'
center
'
,
textBaseline
:
'
middle
'
,
textBaseline
:
'
middle
'
,
textColor
:
dataRangeOption
.
textStyle
.
color
,
color
:
getColor
(
dataRangeOption
.
max
),
width
:
0
,
// for ondrif计算统一
...
...
@@ -483,7 +491,7 @@ define(function (require) {
textY
:
textYEnd
,
textPosition
:
'
specific
'
,
textAlign
:
'
center
'
,
textBaseline
:
'
middle
'
,
textBaseline
:
'
middle
'
,
textColor
:
dataRangeOption
.
textStyle
.
color
,
color
:
getColor
(
dataRangeOption
.
min
),
width
:
0
,
// for ondrif计算统一
...
...
@@ -576,7 +584,7 @@ define(function (require) {
var
totalWidth
=
0
;
var
totalHeight
=
0
;
var
font
=
self
.
getFont
(
dataRangeOption
.
textStyle
);
var
textHeight
=
zrArea
.
getText
Width
(
'
国
'
,
font
);
var
textHeight
=
zrArea
.
getText
Height
(
'
国
'
,
font
);
if
(
dataRangeOption
.
orient
==
'
horizontal
'
)
{
// 水平布局,计算总宽度
...
...
src/component/title.js
浏览文件 @
35465f14
...
...
@@ -167,11 +167,11 @@ define(function (require) {
zrArea
.
getTextWidth
(
text
,
font
),
zrArea
.
getTextWidth
(
subtext
,
subfont
)
);
var
totalHeight
=
zrArea
.
getText
Width
(
'
国
'
,
font
)
var
totalHeight
=
zrArea
.
getText
Height
(
text
,
font
)
+
(
subtext
===
''
?
0
:
(
titleOption
.
itemGap
+
zrArea
.
getText
Width
(
'
国
'
,
subfont
))
+
zrArea
.
getText
Height
(
subtext
,
subfont
))
);
var
x
;
...
...
src/component/toolbox.js
浏览文件 @
35465f14
...
...
@@ -116,13 +116,13 @@ define(function (require) {
var
textFont
=
self
.
getFont
(
toolboxOption
.
textStyle
);
var
textPosition
;
var
textAlign
;
var
textBase
L
ine
;
var
textBase
l
ine
;
if
(
toolboxOption
.
orient
==
'
horizontal
'
)
{
textPosition
=
_itemGroupLocation
.
y
/
zr
.
getHeight
()
<
0.5
?
'
bottom
'
:
'
top
'
;
textAlign
=
_itemGroupLocation
.
x
/
zr
.
getWidth
()
<
0.5
?
'
left
'
:
'
right
'
;
textBase
L
ine
=
_itemGroupLocation
.
y
/
zr
.
getHeight
()
<
0.5
textBase
l
ine
=
_itemGroupLocation
.
y
/
zr
.
getHeight
()
<
0.5
?
'
top
'
:
'
bottom
'
;
}
else
{
...
...
@@ -131,7 +131,7 @@ define(function (require) {
/*
textAlign = _itemGroupLocation.x / zr.getWidth() < 0.5
? 'right' : 'left';
textBase
L
ine = 'top';
textBase
l
ine = 'top';
*/
}
...
...
@@ -174,18 +174,18 @@ define(function (require) {
if
(
i
===
0
&&
textAlign
==
'
left
'
)
{
itemShape
.
highlightStyle
.
textPosition
=
'
specific
'
;
itemShape
.
highlightStyle
.
textAlign
=
textAlign
;
itemShape
.
highlightStyle
.
textBase
Line
=
textBaseL
ine
;
itemShape
.
highlightStyle
.
textBase
line
=
textBasel
ine
;
itemShape
.
highlightStyle
.
textX
=
lastX
;
itemShape
.
highlightStyle
.
textY
=
textBase
L
ine
==
'
top
'
itemShape
.
highlightStyle
.
textY
=
textBase
l
ine
==
'
top
'
?
lastY
+
itemSize
+
10
:
lastY
-
10
;
}
if
(
i
==
iconLength
-
1
&&
textAlign
==
'
right
'
)
{
itemShape
.
highlightStyle
.
textPosition
=
'
specific
'
;
itemShape
.
highlightStyle
.
textAlign
=
textAlign
;
itemShape
.
highlightStyle
.
textBase
Line
=
textBaseL
ine
;
itemShape
.
highlightStyle
.
textBase
line
=
textBasel
ine
;
itemShape
.
highlightStyle
.
textX
=
lastX
+
itemSize
;
itemShape
.
highlightStyle
.
textY
=
textBase
L
ine
==
'
top
'
itemShape
.
highlightStyle
.
textY
=
textBase
l
ine
==
'
top
'
?
lastY
+
itemSize
+
10
:
lastY
-
10
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录