Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
60ebda52
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,体验更适合开发者的 AI 搜索 >>
提交
60ebda52
编写于
11月 17, 2015
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Label enhancement
上级
830889d9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
37 addition
and
40 deletion
+37
-40
src/chart/bar/BarSeries.js
src/chart/bar/BarSeries.js
+11
-18
src/chart/bar/BarView.js
src/chart/bar/BarView.js
+17
-12
src/chart/helper/SymbolDraw.js
src/chart/helper/SymbolDraw.js
+4
-2
src/chart/scatter/ScatterSeries.js
src/chart/scatter/ScatterSeries.js
+5
-8
未找到文件。
src/chart/bar/BarSeries.js
浏览文件 @
60ebda52
...
...
@@ -37,26 +37,19 @@ define(function(require) {
barGap
:
'
30%
'
,
// 类目间柱形距离,默认为类目间距的20%,可设固定值
barCategoryGap
:
'
20%
'
,
label
:
{
normal
:
{
show
:
false
//
formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
//
label: {
//
normal: {
//
show: false
//
formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// 默认自适应,水平布局为'top',垂直布局为'right',可选为
// 'inside' | 'insideleft' | 'insideTop' | 'insideRight' | 'insideBottom' |
// 'outside' |'left' | 'right'|'top'|'bottom'
//
position:
//
// 默认自适应,水平布局为'top',垂直布局为'right',可选为
//
// 'inside' | 'insideleft' | 'insideTop' | 'insideRight' | 'insideBottom' |
//
// 'outside' |'left' | 'right'|'top'|'bottom'
//
position:
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
},
emphasis
:
{
show
:
true
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
// 'inside'|'left'|'right'|'top'|'bottom'
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
}
},
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
// }
// },
itemStyle
:
{
normal
:
{
// color: '各异',
...
...
src/chart/bar/BarView.js
浏览文件 @
60ebda52
...
...
@@ -97,6 +97,14 @@ define(function (require) {
},
_updateStyle
:
function
(
seriesModel
,
data
,
isHorizontal
)
{
function
setLabel
(
style
,
model
,
color
,
labelText
,
labelPositionOutside
)
{
graphic
.
setText
(
style
,
model
,
color
);
style
.
text
=
labelText
;
if
(
style
.
textPosition
===
'
outside
'
)
{
style
.
textPosition
=
labelPositionOutside
;
}
}
data
.
eachItemGraphicEl
(
function
(
rect
,
idx
)
{
var
itemModel
=
data
.
getItemModel
(
idx
);
var
labelModel
=
itemModel
.
getModel
(
'
label.normal
'
);
...
...
@@ -121,22 +129,19 @@ define(function (require) {
var
labelText
=
seriesModel
.
getFormattedLabel
(
idx
,
'
normal
'
)
||
data
.
getRawValue
(
idx
);
var
rectStyle
=
rect
.
style
;
if
(
labelModel
.
get
(
'
show
'
))
{
graphic
.
setText
(
rectStyle
,
labelModel
,
color
);
rectStyle
.
text
=
labelText
;
if
(
rectStyle
.
textPosition
===
'
outside
'
)
{
rectStyle
.
textPosition
=
labelPositionOutside
;
}
var
showLabel
=
labelModel
.
get
(
'
show
'
);
if
(
showLabel
)
{
setLabel
(
rectStyle
,
labelModel
,
color
,
labelText
,
labelPositionOutside
);
}
else
{
rectStyle
.
text
=
''
;
}
if
(
hoverLabelModel
.
get
(
'
show
'
))
{
graphic
.
setText
(
hoverStyle
,
hoverLabelModel
,
color
);
hoverStyle
.
text
=
labelText
;
if
(
hoverStyle
.
textPosition
===
'
outside
'
)
{
hoverStyle
.
textPosition
=
labelPositionOutside
;
}
if
(
zrUtil
.
retrieve
(
hoverLabelModel
.
get
(
'
show
'
),
showLabel
))
{
setLabel
(
hoverStyle
,
hoverLabelModel
,
color
,
labelText
,
labelPositionOutside
);
}
else
{
hoverStyle
.
text
=
''
;
...
...
src/chart/helper/SymbolDraw.js
浏览文件 @
60ebda52
...
...
@@ -179,14 +179,16 @@ define(function (require) {
var
labelText
=
seriesModel
.
getFormattedLabel
(
idx
,
'
normal
'
)
||
data
.
get
(
lastDim
,
idx
);
var
elStyle
=
el
.
style
;
if
(
labelModel
.
get
(
'
show
'
))
{
var
showLabel
=
labelModel
.
get
(
'
show
'
);
if
(
showLabel
)
{
graphic
.
setText
(
elStyle
,
labelModel
,
color
);
elStyle
.
text
=
labelText
;
}
else
{
elStyle
.
text
=
''
;
}
if
(
hoverLabelModel
.
get
(
'
show
'
))
{
if
(
zrUtil
.
retrieve
(
hoverLabelModel
.
get
(
'
show
'
),
showLabel
))
{
graphic
.
setText
(
hoverStyle
,
hoverLabelModel
,
color
);
hoverStyle
.
text
=
labelText
;
}
...
...
src/chart/scatter/ScatterSeries.js
浏览文件 @
60ebda52
...
...
@@ -37,18 +37,15 @@ define(function (require) {
symbolSize
:
10
,
// 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2
// symbolRotate: null, // 图形旋转控制
label
:
{
normal
:
{
show
:
false
//
label: {
//
normal: {
//
show: false
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
// 'inside'|'left'|'right'|'top'|'bottom'
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
},
emphasis
:
{
show
:
true
}
},
// }
// },
itemStyle
:
{
normal
:
{
opacity
:
0.8
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录