Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
z1593
incubator-echarts
提交
d0194afc
I
incubator-echarts
项目概览
z1593
/
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,发现更多精彩内容 >>
提交
d0194afc
编写于
11月 22, 2015
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tweak
上级
7abad407
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
86 addition
and
40 deletion
+86
-40
src/chart/funnel/FunnelSeries.js
src/chart/funnel/FunnelSeries.js
+34
-9
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/pie/PieSeries.js
src/chart/pie/PieSeries.js
+18
-0
src/chart/pie/PieView.js
src/chart/pie/PieView.js
+1
-1
src/chart/pie/labelLayout.js
src/chart/pie/labelLayout.js
+1
-1
src/component/tooltip/TooltipContent.js
src/component/tooltip/TooltipContent.js
+3
-1
src/echarts.js
src/echarts.js
+0
-1
src/model/Series.js
src/model/Series.js
+27
-0
src/preprocessor/fillLabel.js
src/preprocessor/fillLabel.js
+0
-25
未找到文件。
src/chart/funnel/FunnelSeries.js
浏览文件 @
d0194afc
...
@@ -5,7 +5,7 @@ define(function(require) {
...
@@ -5,7 +5,7 @@ define(function(require) {
var
List
=
require
(
'
../../data/List
'
);
var
List
=
require
(
'
../../data/List
'
);
var
SeriesModel
=
require
(
'
../../model/Series
'
);
var
SeriesModel
=
require
(
'
../../model/Series
'
);
var
Pie
Series
=
SeriesModel
.
extend
({
var
Funnel
Series
=
SeriesModel
.
extend
({
type
:
'
series.funnel
'
,
type
:
'
series.funnel
'
,
...
@@ -17,6 +17,14 @@ define(function(require) {
...
@@ -17,6 +17,14 @@ define(function(require) {
this
.
legendDataProvider
=
function
()
{
this
.
legendDataProvider
=
function
()
{
return
this
.
_dataBeforeProcessed
;
return
this
.
_dataBeforeProcessed
;
};
};
// Extend labelLine emphasis
// this._defaultLabelLine();
},
mergeOption
:
function
(
newOption
)
{
SeriesModel
.
prototype
.
mergeOption
.
call
(
this
,
newOption
);
this
.
_defaultLabelLine
();
},
},
getInitialData
:
function
(
option
,
ecModel
)
{
getInitialData
:
function
(
option
,
ecModel
)
{
...
@@ -25,6 +33,20 @@ define(function(require) {
...
@@ -25,6 +33,20 @@ define(function(require) {
return
list
;
return
list
;
},
},
_defaultLabelLine
:
function
()
{
// Extend labelLine emphasis
this
.
defaultEmphasis
(
'
labelLine
'
,
[
'
show
'
]);
var
option
=
this
.
option
;
var
labelLineNormalOpt
=
option
.
labelLine
.
normal
;
var
labelLineEmphasisOpt
=
option
.
labelLine
.
emphasis
;
// Not show label line if `label.normal.show = false`
labelLineNormalOpt
.
show
=
labelLineNormalOpt
.
show
&&
option
.
label
.
normal
.
show
;
labelLineEmphasisOpt
.
show
=
labelLineEmphasisOpt
.
show
&&
option
.
label
.
emphasis
.
show
;
},
defaultOption
:
{
defaultOption
:
{
zlevel
:
0
,
// 一级层叠
zlevel
:
0
,
// 一级层叠
z
:
2
,
// 二级层叠
z
:
2
,
// 二级层叠
...
@@ -55,6 +77,7 @@ define(function(require) {
...
@@ -55,6 +77,7 @@ define(function(require) {
}
}
},
},
labelLine
:
{
labelLine
:
{
normal
:
{
show
:
true
,
show
:
true
,
length
:
20
,
length
:
20
,
lineStyle
:
{
lineStyle
:
{
...
@@ -63,6 +86,8 @@ define(function(require) {
...
@@ -63,6 +86,8 @@ define(function(require) {
type
:
'
solid
'
type
:
'
solid
'
}
}
},
},
emphasis
:
{}
},
itemStyle
:
{
itemStyle
:
{
normal
:
{
normal
:
{
// color: 各异,
// color: 各异,
...
@@ -76,5 +101,5 @@ define(function(require) {
...
@@ -76,5 +101,5 @@ define(function(require) {
}
}
});
});
return
Pie
Series
;
return
Funnel
Series
;
});
});
\ No newline at end of file
src/chart/funnel/FunnelView.js
浏览文件 @
d0194afc
...
@@ -185,7 +185,7 @@ define(function (require) {
...
@@ -185,7 +185,7 @@ define(function (require) {
textFont
:
textStyleModel
.
getFont
()
textFont
:
textStyleModel
.
getFont
()
});
});
// Default use item visual color
// Default use item visual color
labelLine
.
attr
(
'
ignore
'
,
!
itemModel
.
get
(
'
labelLine.show
'
));
labelLine
.
attr
(
'
ignore
'
,
!
itemModel
.
get
(
'
labelLine.
normal.
show
'
));
labelLine
.
setStyle
({
labelLine
.
setStyle
({
stroke
:
visualColor
stroke
:
visualColor
});
});
...
...
src/chart/funnel/funnelLayout.js
浏览文件 @
d0194afc
...
@@ -40,7 +40,7 @@ define(function (require) {
...
@@ -40,7 +40,7 @@ define(function (require) {
var
labelModel
=
itemModel
.
getModel
(
'
label.normal
'
);
var
labelModel
=
itemModel
.
getModel
(
'
label.normal
'
);
var
labelPosition
=
labelModel
.
get
(
'
position
'
);
var
labelPosition
=
labelModel
.
get
(
'
position
'
);
var
labelLineModel
=
itemModel
.
getModel
(
'
labelLine
'
);
var
labelLineModel
=
itemModel
.
getModel
(
'
labelLine
.normal
'
);
var
layout
=
data
.
getItemLayout
(
idx
);
var
layout
=
data
.
getItemLayout
(
idx
);
var
points
=
layout
.
points
;
var
points
=
layout
.
points
;
...
...
src/chart/pie/PieSeries.js
浏览文件 @
d0194afc
...
@@ -25,12 +25,16 @@ define(function(require) {
...
@@ -25,12 +25,16 @@ define(function(require) {
};
};
this
.
updateSelectedMap
();
this
.
updateSelectedMap
();
this
.
_defaultLabelLine
();
},
},
// Overwrite
// Overwrite
mergeOption
:
function
(
newOption
)
{
mergeOption
:
function
(
newOption
)
{
seriesModelProto
.
mergeOption
.
call
(
this
,
newOption
);
seriesModelProto
.
mergeOption
.
call
(
this
,
newOption
);
this
.
updateSelectedMap
();
this
.
updateSelectedMap
();
this
.
_defaultLabelLine
();
},
},
getInitialData
:
function
(
option
,
ecModel
)
{
getInitialData
:
function
(
option
,
ecModel
)
{
...
@@ -49,6 +53,20 @@ define(function(require) {
...
@@ -49,6 +53,20 @@ define(function(require) {
return
params
;
return
params
;
},
},
_defaultLabelLine
:
function
()
{
// Extend labelLine emphasis
this
.
defaultEmphasis
(
'
labelLine
'
,
[
'
show
'
]);
var
option
=
this
.
option
;
var
labelLineNormalOpt
=
option
.
labelLine
.
normal
;
var
labelLineEmphasisOpt
=
option
.
labelLine
.
emphasis
;
// Not show label line if `label.normal.show = false`
labelLineNormalOpt
.
show
=
labelLineNormalOpt
.
show
&&
option
.
label
.
normal
.
show
;
labelLineEmphasisOpt
.
show
=
labelLineEmphasisOpt
.
show
&&
option
.
label
.
emphasis
.
show
;
},
defaultOption
:
{
defaultOption
:
{
zlevel
:
0
,
zlevel
:
0
,
z
:
2
,
z
:
2
,
...
...
src/chart/pie/PieView.js
浏览文件 @
d0194afc
...
@@ -169,7 +169,7 @@ define(function (require) {
...
@@ -169,7 +169,7 @@ define(function (require) {
var
textStyleModel
=
labelModel
.
getModel
(
'
textStyle
'
);
var
textStyleModel
=
labelModel
.
getModel
(
'
textStyle
'
);
var
labelPosition
=
labelModel
.
get
(
'
position
'
);
var
labelPosition
=
labelModel
.
get
(
'
position
'
);
var
isLabelInside
=
labelPosition
===
'
inside
'
;
var
isLabelInside
=
labelPosition
===
'
inside
'
||
labelPosition
===
'
inner
'
;
labelText
.
setStyle
({
labelText
.
setStyle
({
fill
:
textStyleModel
.
get
(
'
color
'
)
fill
:
textStyleModel
.
get
(
'
color
'
)
...
...
src/chart/pie/labelLayout.js
浏览文件 @
d0194afc
...
@@ -167,7 +167,7 @@ define(function (require) {
...
@@ -167,7 +167,7 @@ define(function (require) {
textAlign
=
'
center
'
;
textAlign
=
'
center
'
;
}
}
else
{
else
{
var
isLabelInside
=
labelPosition
===
'
inside
'
;
var
isLabelInside
=
labelPosition
===
'
inside
'
||
labelPosition
===
'
inner
'
;
var
x1
=
(
isLabelInside
?
layout
.
r
/
2
*
dx
:
layout
.
r
*
dx
)
+
cx
;
var
x1
=
(
isLabelInside
?
layout
.
r
/
2
*
dx
:
layout
.
r
*
dx
)
+
cx
;
var
y1
=
(
isLabelInside
?
layout
.
r
/
2
*
dy
:
layout
.
r
*
dy
)
+
cy
;
var
y1
=
(
isLabelInside
?
layout
.
r
/
2
*
dy
:
layout
.
r
*
dy
)
+
cy
;
...
...
src/component/tooltip/TooltipContent.js
浏览文件 @
d0194afc
...
@@ -149,7 +149,9 @@ define(function (require) {
...
@@ -149,7 +149,9 @@ define(function (require) {
},
},
setContent
:
function
(
content
)
{
setContent
:
function
(
content
)
{
this
.
el
.
innerHTML
=
content
;
var
el
=
this
.
el
;
el
.
innerHTML
=
content
;
el
.
style
.
display
=
content
?
'
block
'
:
'
none
'
;
},
},
moveTo
:
function
(
x
,
y
)
{
moveTo
:
function
(
x
,
y
)
{
...
...
src/echarts.js
浏览文件 @
d0194afc
...
@@ -879,7 +879,6 @@ define(function (require) {
...
@@ -879,7 +879,6 @@ define(function (require) {
echarts
.
registerVisualCoding
(
'
echarts
'
,
require
(
'
./visual/seriesColor
'
));
echarts
.
registerVisualCoding
(
'
echarts
'
,
require
(
'
./visual/seriesColor
'
));
echarts
.
registerPreprocessor
(
require
(
'
./preprocessor/backwardCompat
'
));
echarts
.
registerPreprocessor
(
require
(
'
./preprocessor/backwardCompat
'
));
echarts
.
registerPreprocessor
(
require
(
'
./preprocessor/fillLabel
'
));
// Default action
// Default action
echarts
.
registerAction
({
echarts
.
registerAction
({
...
...
src/model/Series.js
浏览文件 @
d0194afc
...
@@ -51,12 +51,20 @@ define(function(require) {
...
@@ -51,12 +51,20 @@ define(function(require) {
this
.
_dataBeforeProcessed
=
this
.
_data
.
cloneShallow
();
this
.
_dataBeforeProcessed
=
this
.
_data
.
cloneShallow
();
},
},
/**
* Util for merge default and theme to option
* @param {Object} option
* @param {module:echarts/model/Global} ecModel
*/
mergeDefaultAndTheme
:
function
(
option
,
ecModel
)
{
mergeDefaultAndTheme
:
function
(
option
,
ecModel
)
{
zrUtil
.
merge
(
zrUtil
.
merge
(
option
,
option
,
ecModel
.
getTheme
().
get
(
ComponentModel
.
parseClassType
(
this
.
type
).
sub
)
ecModel
.
getTheme
().
get
(
ComponentModel
.
parseClassType
(
this
.
type
).
sub
)
);
);
zrUtil
.
merge
(
option
,
this
.
getDefaultOption
());
zrUtil
.
merge
(
option
,
this
.
getDefaultOption
());
// Default label emphasis `position` and `show`
this
.
defaultEmphasis
(
'
label
'
);
},
},
mergeOption
:
function
(
newSeriesOption
,
ecModel
)
{
mergeOption
:
function
(
newSeriesOption
,
ecModel
)
{
...
@@ -68,6 +76,25 @@ define(function(require) {
...
@@ -68,6 +76,25 @@ define(function(require) {
this
.
_data
=
data
;
this
.
_data
=
data
;
this
.
_dataBeforeProcessed
=
data
.
cloneShallow
();
this
.
_dataBeforeProcessed
=
data
.
cloneShallow
();
}
}
this
.
defaultEmphasis
(
'
label
'
);
},
/**
* Util for default emphasis option from normal option like `position` and `show`
* @param {string} optName
* @param {Array.<string>} [subOpts=['position', 'show']]
*/
defaultEmphasis
:
function
(
optName
,
subOpts
)
{
var
opt
=
this
.
get
(
optName
);
if
(
opt
&&
opt
.
normal
)
{
var
emphasisOpt
=
opt
.
emphasis
=
opt
.
emphasis
||
{};
subOpts
=
subOpts
||
[
'
position
'
,
'
show
'
];
zrUtil
.
each
(
subOpts
,
function
(
subOptName
)
{
emphasisOpt
[
subOptName
]
=
zrUtil
.
retrieve
(
emphasisOpt
[
subOptName
],
opt
.
normal
[
subOptName
]);
});
}
},
},
/**
/**
...
...
src/preprocessor/fillLabel.js
已删除
100644 → 0
浏览文件 @
7abad407
define
(
function
(
require
)
{
var
zrUtil
=
require
(
'
zrender/core/util
'
);
// Extend the emphasis option which has in normal but
// Not in the emphasis, like position, show
function
fillLabel
(
labelOpt
)
{
if
(
labelOpt
)
{
var
normalOpt
=
labelOpt
.
normal
;
if
(
normalOpt
)
{
zrUtil
.
merge
(
labelOpt
.
emphasis
||
(
labelOpt
.
emphasis
=
{}),
normalOpt
);
}
}
}
return
function
(
option
)
{
zrUtil
.
each
(
option
.
series
,
function
(
seriesOpt
)
{
fillLabel
(
seriesOpt
.
label
);
// Label line for pie and funnel
fillLabel
(
seriesOpt
.
labelLine
);
zrUtil
.
each
(
seriesOpt
.
data
,
function
(
dataOpt
)
{
fillLabel
(
dataOpt
.
label
);
fillLabel
(
dataOpt
.
labelLine
);
});
});
};
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录