Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
06c5c3fa
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,发现更多精彩内容 >>
提交
06c5c3fa
编写于
3月 08, 2016
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Optimize multi line label vertical align
上级
b69604a2
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
42 addition
and
43 deletion
+42
-43
src/chart/funnel/FunnelView.js
src/chart/funnel/FunnelView.js
+1
-1
src/chart/funnel/funnelLayout.js
src/chart/funnel/funnelLayout.js
+1
-1
src/chart/gauge/GaugeView.js
src/chart/gauge/GaugeView.js
+2
-2
src/chart/helper/Line.js
src/chart/helper/Line.js
+5
-5
src/chart/line/LineSeries.js
src/chart/line/LineSeries.js
+4
-4
src/chart/pie/PieView.js
src/chart/pie/PieView.js
+1
-1
src/chart/pie/labelLayout.js
src/chart/pie/labelLayout.js
+2
-3
src/chart/themeRiver/ThemeRiverView.js
src/chart/themeRiver/ThemeRiverView.js
+1
-1
src/chart/treemap/TreemapView.js
src/chart/treemap/TreemapView.js
+1
-1
src/component/axis/AngleAxisView.js
src/component/axis/AngleAxisView.js
+1
-1
src/component/axis/AxisBuilder.js
src/component/axis/AxisBuilder.js
+12
-12
src/component/dataZoom/SliderZoomView.js
src/component/dataZoom/SliderZoomView.js
+2
-2
src/component/helper/MapDraw.js
src/component/helper/MapDraw.js
+1
-1
src/component/legend/LegendView.js
src/component/legend/LegendView.js
+1
-1
src/component/timeline/SliderTimelineView.js
src/component/timeline/SliderTimelineView.js
+1
-1
src/component/tooltip/TooltipView.js
src/component/tooltip/TooltipView.js
+1
-1
src/component/visualMap/ContinuousView.js
src/component/visualMap/ContinuousView.js
+2
-2
src/component/visualMap/PiecewiseView.js
src/component/visualMap/PiecewiseView.js
+2
-2
src/util/symbol.js
src/util/symbol.js
+1
-1
未找到文件。
src/chart/funnel/FunnelView.js
浏览文件 @
06c5c3fa
...
...
@@ -127,7 +127,7 @@ define(function (require) {
labelText
.
attr
({
style
:
{
textAlign
:
labelLayout
.
textAlign
,
text
Baseline
:
labelLayout
.
textBaseline
,
text
VerticalAlign
:
labelLayout
.
verticalAlign
,
textFont
:
labelLayout
.
font
},
rotation
:
labelLayout
.
rotation
,
...
...
src/chart/funnel/funnelLayout.js
浏览文件 @
06c5c3fa
...
...
@@ -87,7 +87,7 @@ define(function (require) {
linePoints
:
linePoints
,
x
:
textX
,
y
:
textY
,
textBaseline
:
'
middle
'
,
verticalAlign
:
'
middle
'
,
textAlign
:
textAlign
,
inside
:
isLabelInside
};
...
...
src/chart/gauge/GaugeView.js
浏览文件 @
06c5c3fa
...
...
@@ -210,7 +210,7 @@ define(function (require) {
y
:
unitY
*
(
r
-
splitLineLen
-
5
)
+
cy
,
fill
:
textStyleModel
.
getTextColor
(),
textFont
:
textStyleModel
.
getFont
(),
text
Baseline
:
unitY
<
-
0.4
?
'
top
'
:
(
unitY
>
0.4
?
'
bottom
'
:
'
middle
'
),
text
VerticalAlign
:
unitY
<
-
0.4
?
'
top
'
:
(
unitY
>
0.4
?
'
bottom
'
:
'
middle
'
),
textAlign
:
unitX
<
-
0.4
?
'
left
'
:
(
unitX
>
0.4
?
'
right
'
:
'
center
'
)
},
silent
:
true
...
...
@@ -357,7 +357,7 @@ define(function (require) {
fill
:
textStyleModel
.
getTextColor
(),
textFont
:
textStyleModel
.
getFont
(),
textAlign
:
'
center
'
,
text
Baseline
:
'
middle
'
text
VerticalAlign
:
'
middle
'
}
});
this
.
group
.
add
(
text
);
...
...
src/chart/helper/Line.js
浏览文件 @
06c5c3fa
...
...
@@ -100,23 +100,23 @@ define(function (require) {
var
textPosition
;
var
textAlign
;
var
text
Baseline
;
var
text
VerticalAlign
;
// End
if
(
label
.
__position
===
'
end
'
)
{
textPosition
=
[
d
[
0
]
*
5
+
toPos
[
0
],
d
[
1
]
*
5
+
toPos
[
1
]];
textAlign
=
d
[
0
]
>
0.8
?
'
left
'
:
(
d
[
0
]
<
-
0.8
?
'
right
'
:
'
center
'
);
text
Baseline
=
d
[
1
]
>
0.8
?
'
top
'
:
(
d
[
1
]
<
-
0.8
?
'
bottom
'
:
'
middle
'
);
text
VerticalAlign
=
d
[
1
]
>
0.8
?
'
top
'
:
(
d
[
1
]
<
-
0.8
?
'
bottom
'
:
'
middle
'
);
}
// Start
else
{
textPosition
=
[
-
d
[
0
]
*
5
+
fromPos
[
0
],
-
d
[
1
]
*
5
+
fromPos
[
1
]];
textAlign
=
d
[
0
]
>
0.8
?
'
right
'
:
(
d
[
0
]
<
-
0.8
?
'
left
'
:
'
center
'
);
text
Baseline
=
d
[
1
]
>
0.8
?
'
bottom
'
:
(
d
[
1
]
<
-
0.8
?
'
top
'
:
'
middle
'
);
text
VerticalAlign
=
d
[
1
]
>
0.8
?
'
bottom
'
:
(
d
[
1
]
<
-
0.8
?
'
top
'
:
'
middle
'
);
}
label
.
attr
({
style
:
{
// Use the user specified text align and baseline first
text
Baseline
:
label
.
__textBaseline
||
textBaseline
,
text
VerticalAlign
:
label
.
__verticalAlign
||
textVerticalAlign
,
textAlign
:
label
.
__textAlign
||
textAlign
},
position
:
textPosition
...
...
@@ -263,7 +263,7 @@ define(function (require) {
fill
:
textStyleHoverModel
.
getTextColor
()
};
label
.
__textAlign
=
textStyleModel
.
get
(
'
align
'
);
label
.
__
textBaseline
=
textStyleModel
.
get
(
'
baseline
'
);
label
.
__
verticalAlign
=
textStyleModel
.
get
(
'
baseline
'
);
label
.
__position
=
labelModel
.
get
(
'
position
'
);
graphic
.
setHoverStyle
(
...
...
src/chart/line/LineSeries.js
浏览文件 @
06c5c3fa
...
...
@@ -39,15 +39,15 @@ define(function(require) {
// position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
// 'inside'|'left'|'right'|'top'|'bottom'
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
}
,
emphasis
:
{
}
//
emphasis: {
// show: false,
position
:
'
top
'
//
position: 'top'
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
// 'inside'|'left'|'right'|'top'|'bottom'
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
}
//
}
},
// itemStyle: {
// normal: {
...
...
src/chart/pie/PieView.js
浏览文件 @
06c5c3fa
...
...
@@ -215,8 +215,8 @@ define(function (require) {
},
seriesModel
);
labelText
.
attr
({
style
:
{
textVerticalAlign
:
labelLayout
.
verticalAlign
,
textAlign
:
labelLayout
.
textAlign
,
textBaseline
:
labelLayout
.
textBaseline
,
textFont
:
labelLayout
.
font
},
rotation
:
labelLayout
.
rotation
,
...
...
src/chart/pie/labelLayout.js
浏览文件 @
06c5c3fa
...
...
@@ -191,7 +191,6 @@ define(function (require) {
textAlign
=
isLabelInside
?
'
center
'
:
(
dx
>
0
?
'
left
'
:
'
right
'
);
}
var
textBaseline
=
'
middle
'
;
var
font
=
labelModel
.
getModel
(
'
textStyle
'
).
getFont
();
var
labelRotate
=
labelModel
.
get
(
'
rotate
'
)
...
...
@@ -199,7 +198,7 @@ define(function (require) {
var
text
=
seriesModel
.
getFormattedLabel
(
idx
,
'
normal
'
)
||
data
.
getName
(
idx
);
var
textRect
=
textContain
.
getBoundingRect
(
text
,
font
,
textAlign
,
textBaseline
text
,
font
,
textAlign
,
'
top
'
);
hasLabelRotate
=
!!
labelRotate
;
layout
.
label
=
{
...
...
@@ -210,7 +209,7 @@ define(function (require) {
length2
:
labelLineLen2
,
linePoints
:
linePoints
,
textAlign
:
textAlign
,
textBaseline
:
textBaseline
,
verticalAlign
:
'
middle
'
,
font
:
font
,
rotation
:
labelRotate
};
...
...
src/chart/themeRiver/ThemeRiverView.js
浏览文件 @
06c5c3fa
...
...
@@ -136,7 +136,7 @@ define(function (require) {
:
''
,
textFont
:
textStyleModel
.
getFont
(),
textAlign
:
labelModel
.
get
(
'
textAlign
'
),
text
Baseline
:
'
middle
'
text
VerticalAlign
:
'
middle
'
});
polygon
.
setStyle
(
zrUtil
.
extend
({
...
...
src/chart/treemap/TreemapView.js
浏览文件 @
06c5c3fa
...
...
@@ -325,7 +325,7 @@
textPosition
:
labelModel
.
get
(
'
position
'
),
textFill
:
textStyleModel
.
getTextColor
(),
textAlign
:
textStyleModel
.
get
(
'
align
'
),
text
Baseline
:
textStyleModel
.
get
(
'
baseline
'
),
text
VerticalAlign
:
textStyleModel
.
get
(
'
baseline
'
),
textFont
:
textStyleModel
.
getFont
()
});
group
.
add
(
content
);
...
...
src/component/axis/AngleAxisView.js
浏览文件 @
06c5c3fa
...
...
@@ -128,7 +128,7 @@ define(function (require) {
fill
:
textStyleModel
.
getTextColor
(),
text
:
labels
[
i
],
textAlign
:
labelTextAlign
,
text
Baseline
:
labelTextBaseline
,
text
VerticalAlign
:
labelTextBaseline
,
textFont
:
textStyleModel
.
getFont
()
},
silent
:
true
...
...
src/component/axis/AxisBuilder.js
浏览文件 @
06c5c3fa
...
...
@@ -233,7 +233,7 @@ define(function (require) {
style
:
{
text
:
labels
[
i
],
textAlign
:
itemTextStyleModel
.
get
(
'
align
'
,
true
)
||
labelLayout
.
textAlign
,
text
Baseline
:
itemTextStyleModel
.
get
(
'
baseline
'
,
true
)
||
labelLayout
.
textBaseline
,
text
VerticalAlign
:
itemTextStyleModel
.
get
(
'
baseline
'
,
true
)
||
labelLayout
.
verticalAlign
,
textFont
:
itemTextStyleModel
.
getFont
(),
fill
:
itemTextStyleModel
.
getTextColor
()
},
...
...
@@ -326,7 +326,7 @@ define(function (require) {
fill
:
textStyleModel
.
getTextColor
()
||
axisModel
.
get
(
'
axisLine.lineStyle.color
'
),
textAlign
:
labelLayout
.
textAlign
,
text
Baseline
:
labelLayout
.
textBaseline
text
VerticalAlign
:
labelLayout
.
verticalAlign
},
position
:
pos
,
rotation
:
labelLayout
.
rotation
,
...
...
@@ -343,18 +343,18 @@ define(function (require) {
function
innerTextLayout
(
opt
,
textRotation
,
direction
)
{
var
rotationDiff
=
remRadian
(
textRotation
-
opt
.
rotation
);
var
textAlign
;
var
textBaseline
;
var
verticalAlign
;
if
(
isRadianAroundZero
(
rotationDiff
))
{
// Label is parallel with axis line.
textBaseline
=
direction
>
0
?
'
top
'
:
'
bottom
'
;
verticalAlign
=
direction
>
0
?
'
top
'
:
'
bottom
'
;
textAlign
=
'
center
'
;
}
else
if
(
isRadianAroundZero
(
rotationDiff
-
PI
))
{
// Label is inverse parallel with axis line.
textBaseline
=
direction
>
0
?
'
bottom
'
:
'
top
'
;
verticalAlign
=
direction
>
0
?
'
bottom
'
:
'
top
'
;
textAlign
=
'
center
'
;
}
else
{
textBaseline
=
'
middle
'
;
verticalAlign
=
'
middle
'
;
if
(
rotationDiff
>
0
&&
rotationDiff
<
PI
)
{
textAlign
=
direction
>
0
?
'
right
'
:
'
left
'
;
...
...
@@ -367,7 +367,7 @@ define(function (require) {
return
{
rotation
:
rotationDiff
,
textAlign
:
textAlign
,
textBaseline
:
textBaseline
verticalAlign
:
verticalAlign
};
}
...
...
@@ -377,21 +377,21 @@ define(function (require) {
function
endTextLayout
(
opt
,
textPosition
,
extent
)
{
var
rotationDiff
=
remRadian
(
-
opt
.
rotation
);
var
textAlign
;
var
textBaseline
;
var
verticalAlign
;
var
inverse
=
extent
[
0
]
>
extent
[
1
];
var
onLeft
=
(
textPosition
===
'
start
'
&&
!
inverse
)
||
(
textPosition
!==
'
start
'
&&
inverse
);
if
(
isRadianAroundZero
(
rotationDiff
-
PI
/
2
))
{
textBaseline
=
onLeft
?
'
bottom
'
:
'
top
'
;
verticalAlign
=
onLeft
?
'
bottom
'
:
'
top
'
;
textAlign
=
'
center
'
;
}
else
if
(
isRadianAroundZero
(
rotationDiff
-
PI
*
1.5
))
{
textBaseline
=
onLeft
?
'
top
'
:
'
bottom
'
;
verticalAlign
=
onLeft
?
'
top
'
:
'
bottom
'
;
textAlign
=
'
center
'
;
}
else
{
textBaseline
=
'
middle
'
;
verticalAlign
=
'
middle
'
;
if
(
rotationDiff
<
PI
*
1.5
&&
rotationDiff
>
PI
/
2
)
{
textAlign
=
onLeft
?
'
left
'
:
'
right
'
;
}
...
...
@@ -403,7 +403,7 @@ define(function (require) {
return
{
rotation
:
rotationDiff
,
textAlign
:
textAlign
,
textBaseline
:
textBaseline
verticalAlign
:
verticalAlign
};
}
...
...
src/component/dataZoom/SliderZoomView.js
浏览文件 @
06c5c3fa
...
...
@@ -418,7 +418,7 @@ define(function (require) {
invisible
:
true
,
style
:
{
x
:
0
,
y
:
0
,
text
:
''
,
text
Baseline
:
'
middle
'
,
text
VerticalAlign
:
'
middle
'
,
textAlign
:
'
center
'
,
fill
:
textStyleModel
.
getTextColor
(),
textFont
:
textStyleModel
.
getFont
()
...
...
@@ -559,7 +559,7 @@ define(function (require) {
handleLabels
[
handleIndex
].
setStyle
({
x
:
textPoint
[
0
],
y
:
textPoint
[
1
],
text
Baseline
:
orient
===
HORIZONTAL
?
'
middle
'
:
direction
,
text
VerticalAlign
:
orient
===
HORIZONTAL
?
'
middle
'
:
direction
,
textAlign
:
orient
===
HORIZONTAL
?
direction
:
'
center
'
,
text
:
labelTexts
[
handleIndex
]
});
...
...
src/component/helper/MapDraw.js
浏览文件 @
06c5c3fa
...
...
@@ -187,7 +187,7 @@ define(function (require) {
fill
:
textStyleModel
.
getTextColor
(),
textFont
:
textStyleModel
.
getFont
(),
textAlign
:
'
center
'
,
text
Baseline
:
'
middle
'
text
VerticalAlign
:
'
middle
'
},
hoverStyle
:
{
text
:
hoverShowLabel
?
(
hoverFormattedStr
||
region
.
name
)
:
''
,
...
...
src/component/legend/LegendView.js
浏览文件 @
06c5c3fa
...
...
@@ -197,7 +197,7 @@ define(function (require) {
fill
:
isSelected
?
textStyleModel
.
getTextColor
()
:
LEGEND_DISABLE_COLOR
,
textFont
:
textStyleModel
.
getFont
(),
textAlign
:
textAlign
,
text
Baseline
:
'
middle
'
text
VerticalAlign
:
'
middle
'
}
});
itemGroup
.
add
(
text
);
...
...
src/component/timeline/SliderTimelineView.js
浏览文件 @
06c5c3fa
...
...
@@ -423,7 +423,7 @@ define(function (require) {
style
:
{
text
:
labels
[
dataIndex
],
textAlign
:
layoutInfo
.
labelAlign
,
text
Baseline
:
layoutInfo
.
labelBaseline
,
text
VerticalAlign
:
layoutInfo
.
labelBaseline
,
textFont
:
itemTextStyleModel
.
getFont
(),
fill
:
itemTextStyleModel
.
getTextColor
()
},
...
...
src/component/tooltip/TooltipView.js
浏览文件 @
06c5c3fa
...
...
@@ -786,7 +786,7 @@ define(function (require) {
text
=
this
.
_crossText
=
new
graphic
.
Text
({
style
:
{
textAlign
:
'
left
'
,
text
Baseline
:
'
bottom
'
text
VerticalAlign
:
'
bottom
'
}
});
this
.
group
.
add
(
text
);
...
...
src/component/visualMap/ContinuousView.js
浏览文件 @
06c5c3fa
...
...
@@ -136,7 +136,7 @@ define(function(require) {
style
:
{
x
:
position
[
0
],
y
:
position
[
1
],
text
Baseline
:
orient
===
'
horizontal
'
?
'
middle
'
:
align
,
text
VerticalAlign
:
orient
===
'
horizontal
'
?
'
middle
'
:
align
,
textAlign
:
orient
===
'
horizontal
'
?
align
:
'
center
'
,
text
:
text
,
textFont
:
textStyleModel
.
getFont
(),
...
...
@@ -213,7 +213,7 @@ define(function(require) {
silent
:
true
,
style
:
{
x
:
0
,
y
:
0
,
text
:
''
,
text
Baseline
:
'
middle
'
,
text
VerticalAlign
:
'
middle
'
,
textFont
:
textStyleModel
.
getFont
(),
fill
:
textStyleModel
.
getTextColor
()
}
...
...
src/component/visualMap/PiecewiseView.js
浏览文件 @
06c5c3fa
...
...
@@ -58,7 +58,7 @@ define(function(require) {
x
:
itemAlign
===
'
right
'
?
-
textGap
:
itemSize
[
0
]
+
textGap
,
y
:
itemSize
[
1
]
/
2
,
text
:
item
.
piece
.
text
,
text
Baseline
:
'
middle
'
,
text
VerticalAlign
:
'
middle
'
,
textAlign
:
itemAlign
,
textFont
:
textFont
,
fill
:
textFill
...
...
@@ -103,7 +103,7 @@ define(function(require) {
style
:
{
x
:
itemSize
[
0
]
/
2
,
y
:
itemSize
[
1
]
/
2
,
text
Baseline
:
'
middle
'
,
text
VerticalAlign
:
'
middle
'
,
textAlign
:
'
center
'
,
text
:
text
,
textFont
:
textStyleModel
.
getFont
(),
...
...
src/util/symbol.js
浏览文件 @
06c5c3fa
...
...
@@ -255,7 +255,7 @@ define(function(require) {
if
(
shape
.
symbolType
===
'
pin
'
&&
style
.
textPosition
===
'
inside
'
)
{
style
.
textPosition
=
[
'
50%
'
,
'
40%
'
];
style
.
textAlign
=
'
center
'
;
style
.
text
Baseline
=
'
middle
'
;
style
.
text
VerticalAlign
=
'
middle
'
;
}
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录