Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
3aacd5fb
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,发现更多精彩内容 >>
提交
3aacd5fb
编写于
1月 08, 2018
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Enable series name specify in encode.
上级
7af19ce0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
40 addition
and
10 deletion
+40
-10
src/chart/map/MapSeries.js
src/chart/map/MapSeries.js
+1
-1
src/chart/radar/RadarSeries.js
src/chart/radar/RadarSeries.js
+1
-1
src/component/legend/LegendModel.js
src/component/legend/LegendModel.js
+1
-1
src/component/legend/legendFilter.js
src/component/legend/legendFilter.js
+1
-1
src/model/Series.js
src/model/Series.js
+28
-5
src/util/model.js
src/util/model.js
+8
-1
未找到文件。
src/chart/map/MapSeries.js
浏览文件 @
3aacd5fb
...
...
@@ -104,7 +104,7 @@ var MapSeries = SeriesModel.extend({
var
otherIndex
=
seriesGroup
[
i
].
originalData
.
indexOfName
(
name
);
if
(
!
isNaN
(
seriesGroup
[
i
].
originalData
.
get
(
'
value
'
,
otherIndex
)))
{
seriesNames
.
push
(
encodeHTML
(
seriesGroup
[
i
].
name
)
encodeHTML
(
seriesGroup
[
i
].
getDisplayName
()
)
);
}
}
...
...
src/chart/radar/RadarSeries.js
浏览文件 @
3aacd5fb
...
...
@@ -33,7 +33,7 @@ var RadarSeries = SeriesModel.extend({
var
coordSys
=
this
.
coordinateSystem
;
var
indicatorAxes
=
coordSys
.
getIndicatorAxes
();
var
name
=
this
.
getData
().
getName
(
dataIndex
);
return
encodeHTML
(
name
===
''
?
this
.
name
:
name
)
+
'
<br/>
'
return
encodeHTML
(
name
===
''
?
this
.
getDisplayName
()
:
name
)
+
'
<br/>
'
+
zrUtil
.
map
(
indicatorAxes
,
function
(
axis
,
idx
)
{
return
encodeHTML
(
axis
.
name
+
'
:
'
+
value
[
idx
]);
}).
join
(
'
<br />
'
);
...
...
src/component/legend/LegendModel.js
浏览文件 @
3aacd5fb
...
...
@@ -66,7 +66,7 @@ var LegendModel = echarts.extendComponentModel({
this
.
_data
=
legendData
;
var
availableNames
=
zrUtil
.
map
(
ecModel
.
getSeries
(),
function
(
series
)
{
return
series
.
name
;
return
series
.
getDisplayName
()
;
});
ecModel
.
eachSeries
(
function
(
seriesModel
)
{
if
(
seriesModel
.
legendDataProvider
)
{
...
...
src/component/legend/legendFilter.js
浏览文件 @
3aacd5fb
...
...
@@ -8,7 +8,7 @@ export default function (ecModel) {
// If in any legend component the status is not selected.
// Because in legend series is assumed selected when it is not in the legend data.
for
(
var
i
=
0
;
i
<
legendModels
.
length
;
i
++
)
{
if
(
!
legendModels
[
i
].
isSelected
(
series
.
name
))
{
if
(
!
legendModels
[
i
].
isSelected
(
series
.
getDisplayName
()
))
{
return
false
;
}
}
...
...
src/model/Series.js
浏览文件 @
3aacd5fb
...
...
@@ -16,8 +16,9 @@ import {
}
from
'
../util/layout
'
;
import
{
createTask
}
from
'
../stream/task
'
;
import
{
setEncode
,
getSource
prepareSource
,
getSource
,
getSeriesAutoName
}
from
'
../data/helper/sourceHelper
'
;
var
inner
=
modelUtil
.
makeInner
();
...
...
@@ -77,7 +78,7 @@ var SeriesModel = ComponentModel.extend({
this
.
mergeDefaultAndTheme
(
option
,
ecModel
);
setEncod
e
(
this
);
prepareSourc
e
(
this
);
var
data
=
this
.
getInitialData
(
option
,
ecModel
);
...
...
@@ -146,7 +147,7 @@ var SeriesModel = ComponentModel.extend({
mergeLayoutParam
(
this
.
option
,
newSeriesOption
,
layoutMode
);
}
setEncod
e
(
this
);
prepareSourc
e
(
this
);
var
data
=
this
.
getInitialData
(
newSeriesOption
,
ecModel
);
// ??? set dirty on ecModel, becusue it will call mergeOption({})?
...
...
@@ -220,6 +221,28 @@ var SeriesModel = ComponentModel.extend({
return
inner
(
this
).
dataBeforeProcessed
;
},
/**
* Because of some complicated requirements or some historical reasons,
* series.name (or component.name) has too many resposibility:
* (1) Generating id (which requires name in option should not be modified).
* (2) As an index to mapping series when merging option or calling API.
* (3) Display.
* Here Sereis provides method `getDisplayName` to be reponsible for display,
* where the display name can be auto generated by some default rule and
* without modifying series.name in option or effect the other responsibilities
* of series.name.
* @return {string}
*/
getDisplayName
:
function
()
{
// User specified name has higher priority, otherwise it may cause
// series can not be queried unexpectedly.
var
displayName
=
this
.
name
;
if
(
modelUtil
.
DEFAULT_COMPONENT_NAME
===
displayName
)
{
displayName
=
getSeriesAutoName
(
this
)
||
displayName
;
}
return
displayName
;
},
/**
* Coord dimension to data dimension.
*
...
...
@@ -319,7 +342,7 @@ var SeriesModel = ComponentModel.extend({
var
colorEl
=
getTooltipMarker
(
color
);
var
seriesName
=
this
.
name
;
var
seriesName
=
this
.
getDisplayName
()
;
// FIXME
if
(
seriesName
===
'
\
0-
'
)
{
// Not show '-'
...
...
src/util/model.js
浏览文件 @
3aacd5fb
...
...
@@ -4,6 +4,13 @@ import * as formatUtil from './format';
var
each
=
zrUtil
.
each
;
var
isObject
=
zrUtil
.
isObject
;
/**
* name may be displayed on screen, so use '-'.
* But we should make sure it is not duplicated
* with user specified name, so use '\0';
*/
export
var
DEFAULT_COMPONENT_NAME
=
'
\
0-
'
;
/**
* If value is not array, then translate it to array.
* @param {*} value
...
...
@@ -357,7 +364,7 @@ export function makeIdAndName(mapResult) {
?
opt
.
name
+
''
:
existCpt
?
existCpt
.
name
:
'
\
0-
'
;
// name may be displayed on screen, so use '-'.
:
DEFAULT_COMPONENT_NAME
;
if
(
existCpt
)
{
keyInfo
.
id
=
existCpt
.
id
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录