Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
387f8fd4
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,发现更多精彩内容 >>
提交
387f8fd4
编写于
10月 19, 2015
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move areaStyle, lineStyle, label out of itemStyle
上级
ac7ef3e2
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
240 addition
and
146 deletion
+240
-146
src/chart/bar/BarSeries.js
src/chart/bar/BarSeries.js
+26
-18
src/chart/bar/BarView.js
src/chart/bar/BarView.js
+1
-1
src/chart/helper/DataSymbol.js
src/chart/helper/DataSymbol.js
+1
-1
src/chart/line/LineSeries.js
src/chart/line/LineSeries.js
+31
-23
src/chart/line/LineView.js
src/chart/line/LineView.js
+2
-2
src/chart/map/MapSeries.js
src/chart/map/MapSeries.js
+38
-19
src/chart/map/mapVisual.js
src/chart/map/mapVisual.js
+1
-1
src/chart/pie/PieSeries.js
src/chart/pie/PieSeries.js
+27
-38
src/chart/pie/labelLayout.js
src/chart/pie/labelLayout.js
+3
-4
src/chart/scatter/ScatterSeries.js
src/chart/scatter/ScatterSeries.js
+14
-18
src/component/dataRange/dataRangeAction.js
src/component/dataRange/dataRangeAction.js
+4
-4
src/echarts.js
src/echarts.js
+35
-17
src/preprocessor/backwardCompat.js
src/preprocessor/backwardCompat.js
+57
-0
未找到文件。
src/chart/bar/BarSeries.js
浏览文件 @
387f8fd4
...
...
@@ -38,6 +38,26 @@ define(function(require) {
barGap
:
'
30%
'
,
// 类目间柱形距离,默认为类目间距的20%,可设固定值
barCategoryGap
:
'
20%
'
,
label
:
{
normal
:
{
show
:
false
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// 默认自适应,水平布局为'top',垂直布局为'right',可选为
// 'inside' | 'insideleft' | 'insideTop' | 'insideRight' | 'insideBottom' |
// 'outside' |'left' | 'right'|'top'|'bottom'
// position:
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
},
emphasis
:
{
show
:
false
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
// 'inside'|'left'|'right'|'top'|'bottom'
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
}
},
itemStyle
:
{
normal
:
{
// color: '各异',
...
...
@@ -49,28 +69,16 @@ define(function(require) {
barBorderWidth
:
0
,
label
:
{
show
:
false
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// 默认自适应,水平布局为'top',垂直布局为'right',可选为
// 'inside' | 'insideleft' | 'insideTop' | 'insideRight' | 'insideBottom' |
// 'outside' |'left' | 'right'|'top'|'bottom'
// position:
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
}
},
emphasis
:
{
// color: '各异',
barBorderColor
:
'
#fff
'
,
// 柱条边线
barBorderRadius
:
0
,
// 柱条边线圆角,单位px,默认为0
barBorderWidth
:
0
,
// 柱条边线线宽,单位px,默认为1
label
:
{
show
:
false
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
// 'inside'|'left'|'right'|'top'|'bottom'
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
}
// 柱条边线
barBorderColor
:
'
#fff
'
,
// 柱条边线圆角,单位px,默认为0
barBorderRadius
:
0
,
// 柱条边线线宽,单位px,默认为1
barBorderWidth
:
0
,
}
}
}
...
...
src/chart/bar/BarView.js
浏览文件 @
387f8fd4
...
...
@@ -99,7 +99,7 @@ define(function (require) {
_updateStyle
:
function
(
seriesModel
,
data
,
isHorizontal
)
{
data
.
eachItemGraphicEl
(
function
(
rect
,
idx
)
{
var
itemModel
=
data
.
getItemModel
(
idx
);
var
labelModel
=
itemModel
.
getModel
(
'
itemStyle.normal.labe
l
'
);
var
labelModel
=
itemModel
.
getModel
(
'
label.norma
l
'
);
var
color
=
data
.
getItemVisual
(
idx
,
'
color
'
);
var
layout
=
data
.
getItemLayout
(
idx
);
...
...
src/chart/helper/DataSymbol.js
浏览文件 @
387f8fd4
...
...
@@ -196,7 +196,7 @@ define(function (require) {
data
.
eachItemGraphicEl
(
function
(
el
,
idx
)
{
var
itemModel
=
data
.
getItemModel
(
idx
);
var
normalItemStyleModel
=
itemModel
.
getModel
(
itemStyleAccessPath
);
var
labelModel
=
normalItemStyleModel
.
getModel
(
'
labe
l
'
);
var
labelModel
=
itemModel
.
getModel
(
'
label.norma
l
'
);
var
color
=
data
.
getItemVisual
(
idx
,
'
color
'
);
zrUtil
.
extend
(
...
...
src/chart/line/LineSeries.js
浏览文件 @
387f8fd4
...
...
@@ -27,36 +27,44 @@ define(function(require) {
gridIndex
:
0
,
// 'nearest', 'min', 'max', 'average'
dataFilter
:
'
nearest
'
,
label
:
{
normal
:
{
show
:
false
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
// 'inside'|'left'|'right'|'top'|'bottom'
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
},
emphasis
:
{
show
:
false
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
// 'inside'|'left'|'right'|'top'|'bottom'
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
}
},
itemStyle
:
{
normal
:
{
// color: 各异,
label
:
{
show
:
false
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
// 'inside'|'left'|'right'|'top'|'bottom'
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
},
lineStyle
:
{
width
:
2
,
type
:
'
solid
'
,
shadowColor
:
'
rgba(0,0,0,0)
'
,
//默认透明
shadowBlur
:
0
,
shadowOffsetX
:
0
,
shadowOffsetY
:
0
}
// color: 各异
},
emphasis
:
{
// color: 各异,
label
:
{
show
:
false
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
// 'inside'|'left'|'right'|'top'|'bottom'
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
}
}
},
lineStyle
:
{
normal
:
{
width
:
2
,
type
:
'
solid
'
,
shadowColor
:
'
rgba(0,0,0,0)
'
,
//默认透明
shadowBlur
:
0
,
shadowOffsetX
:
0
,
shadowOffsetY
:
0
}
},
// areaStyle: {
// },
// smooth: false,
// 拐点图形类型
symbol
:
'
emptyCircle
'
,
...
...
src/chart/line/LineView.js
浏览文件 @
387f8fd4
...
...
@@ -92,8 +92,8 @@ define(function(require) {
var
coordSys
=
seriesModel
.
coordinateSystem
;
var
group
=
this
.
group
;
var
data
=
seriesModel
.
getData
();
var
lineStyleModel
=
seriesModel
.
getModel
(
'
itemStyle.normal.lineStyle
'
);
var
areaStyleModel
=
seriesModel
.
getModel
(
'
itemStyle.normal.areaStyle
'
);
var
lineStyleModel
=
seriesModel
.
getModel
(
'
lineStyle.normal
'
);
var
areaStyleModel
=
seriesModel
.
getModel
(
'
areaStyle.normal
'
);
var
points
=
data
.
mapArray
(
data
.
getItemLayout
,
true
);
...
...
src/chart/map/MapSeries.js
浏览文件 @
387f8fd4
...
...
@@ -86,35 +86,54 @@ define(function (require) {
clickable
:
true
,
// 是否开启缩放及漫游模式
// roam: false,
// 在 roam 开启的时候使用
roamDetail
:
{
x
:
0
,
y
:
0
,
zoom
:
1
},
label
:
{
normal
:
{
show
:
false
,
textStyle
:
{
color
:
'
#000
'
}
},
emphasis
:
{
show
:
false
,
textStyle
:
{
color
:
'
#000
'
}
}
},
// scaleLimit: null,
itemStyle
:
{
normal
:
{
// color: 各异,
borderWidth
:
0.5
,
borderColor
:
'
#444
'
,
areaStyle
:
{
color
:
'
#eee
'
},
label
:
{
show
:
false
,
textStyle
:
{
color
:
'
#000
'
}
}
areaColor
:
'
#eee
'
},
// 也是选中样式
emphasis
:
{
areaStyle
:
{
color
:
'
rgba(255,215,0,0.8)
'
},
label
:
{
show
:
false
,
textStyle
:
{
color
:
'
#000
'
}
}
areaColor
:
'
rgba(255,215,0,0.8)
'
}
}
}
},
setRoamZoom
:
function
(
zoom
)
{
var
roamDetail
=
this
.
option
.
roamDetail
;
roamDetail
&&
(
roamDetail
.
zoom
=
zoom
);
},
setRoamPan
:
function
(
x
,
y
)
{
var
roamDetail
=
this
.
option
.
roamDetail
;
if
(
roamDetail
)
{
roamDetail
.
x
=
x
;
roamDetail
.
y
=
y
;
}
}
})
});
\ No newline at end of file
src/chart/map/mapVisual.js
浏览文件 @
387f8fd4
...
...
@@ -4,7 +4,7 @@ define(function (require) {
var
colorList
=
ecModel
.
get
(
'
color
'
);
var
itemStyleModel
=
seriesModel
.
getModel
(
'
itemStyle.normal
'
);
var
areaColor
=
itemStyleModel
.
get
(
'
area
Style.c
olor
'
);
var
areaColor
=
itemStyleModel
.
get
(
'
area
C
olor
'
);
var
color
=
itemStyleModel
.
get
(
'
color
'
)
||
colorList
[
seriesModel
.
seriesIndex
%
colorList
.
length
];
...
...
src/chart/pie/PieSeries.js
浏览文件 @
387f8fd4
...
...
@@ -104,52 +104,41 @@ define(function(require) {
// selectedMode: false,
// 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积)
// roseType: null,
label
:
{
normal
:
{
show
:
true
,
// 'outer', 'inside', 'center'
position
:
'
outer
'
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
// distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数
},
emphasis
:
{}
},
// Enabled when label.normal.position is 'outer'
labelLine
:
{
show
:
true
,
// 引导线两段中的第一段长度
length
:
20
,
// 引导线两段中的第二段长度
length2
:
5
,
lineStyle
:
{
// color: 各异,
width
:
1
,
type
:
'
solid
'
}
},
itemStyle
:
{
normal
:
{
// color: 各异,
borderColor
:
'
rgba(0,0,0,0)
'
,
borderWidth
:
1
,
label
:
{
show
:
true
,
// 'outer', 'inside', 'center'
position
:
'
outer
'
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
// distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数
},
labelLine
:
{
show
:
true
,
// 引导线两段中的第一段长度
length
:
20
,
// 引导线两段中的第二段长度
length2
:
5
,
lineStyle
:
{
// color: 各异,
width
:
1
,
type
:
'
solid
'
}
}
borderWidth
:
1
},
emphasis
:
{
// color: 各异,
borderColor
:
'
rgba(0,0,0,0)
'
,
borderWidth
:
1
,
label
:
{
show
:
false
// position: 'outer'
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
// distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数
},
labelLine
:
{
show
:
false
,
length
:
20
,
lineStyle
:
{
// color: 各异,
width
:
1
,
type
:
'
solid
'
}
}
borderWidth
:
1
}
}
}
...
...
src/chart/pie/labelLayout.js
浏览文件 @
387f8fd4
// FIXME emphasis label position is not same with normal label position
define
(
function
(
require
)
{
'
use strict
'
;
...
...
@@ -6,9 +7,7 @@ define(function (require) {
return
function
(
seriesModel
)
{
var
data
=
seriesModel
.
getData
();
var
itemStyleModel
=
seriesModel
.
getModel
(
'
itemStyle.normal
'
);
var
labelLineModel
=
itemStyleModel
.
getModel
(
'
labelLine
'
);
var
labelModel
=
itemStyleModel
.
getModel
(
'
label
'
)
var
labelLineModel
=
seriesModel
.
getModel
(
'
labelLine
'
);
var
labelLineLen
=
labelLineModel
.
get
(
'
length
'
);
var
labelLineLen2
=
labelLineModel
.
get
(
'
length2
'
);
...
...
@@ -18,7 +17,7 @@ define(function (require) {
data
.
each
(
function
(
idx
)
{
var
layout
=
data
.
getItemLayout
(
idx
);
var
itemModel
=
data
.
getItemModel
(
idx
);
var
labelModel
=
itemModel
.
getModel
(
'
itemStyle.normal.labe
l
'
);
var
labelModel
=
itemModel
.
getModel
(
'
label.norma
l
'
);
var
font
=
labelModel
.
getModel
(
'
textStyle
'
).
getFont
();
var
labelPosition
=
labelModel
.
get
(
'
position
'
);
...
...
src/chart/scatter/ScatterSeries.js
浏览文件 @
387f8fd4
...
...
@@ -37,27 +37,23 @@ define(function (require) {
// symbol: null, // 图形类型
symbolSize
:
4
,
// 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2
// symbolRotate: null, // 图形旋转控制
itemStyle
:
{
label
:
{
normal
:
{
opacity
:
0.8
,
// color: 各异,
label
:
{
show
:
false
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
// 'inside'|'left'|'right'|'top'|'bottom'
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
}
show
:
false
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
// 'inside'|'left'|'right'|'top'|'bottom'
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
},
emphasis
:
{
// color: '各异'
label
:
{
show
:
false
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
// position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
// 'inside'|'left'|'right'|'top'|'bottom'
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
}
show
:
false
}
},
itemStyle
:
{
normal
:
{
opacity
:
0.8
,
// color: 各异
}
}
}
...
...
src/component/dataRange/dataRangeAction.js
浏览文件 @
387f8fd4
...
...
@@ -13,11 +13,11 @@ define(function(require) {
update
:
'
updateView
'
};
echarts
.
registerAction
(
actionInfo
,
function
(
event
,
ecModel
)
{
echarts
.
registerAction
(
actionInfo
,
function
(
payload
,
ecModel
)
{
var
fromDataRangeModel
=
ecModel
.
getComponentById
(
event
.
dataRangeModelId
);
var
fromDataRangeModel
=
ecModel
.
getComponentById
(
payload
.
dataRangeModelId
);
fromDataRangeModel
&&
fromDataRangeModel
.
setSelected
(
event
.
selected
);
fromDataRangeModel
&&
fromDataRangeModel
.
setSelected
(
payload
.
selected
);
// Find all dataRangeModel that has the same visualType and controls the same series.
// var linkedNodesFinder = modelUtil.createLinkedNodesFinder(
...
...
@@ -40,7 +40,7 @@ define(function(require) {
// var effectedModels = linkedNodesFinder(fromDataRangeModel).nodes;
// zrUtil.each(effectedModels, function (dataRangeModel) {
// fromDataRangeModel.setSelected(
event
.selected);
// fromDataRangeModel.setSelected(
payload
.selected);
// });
});
...
...
src/echarts.js
浏览文件 @
387f8fd4
...
...
@@ -20,6 +20,8 @@ define(function (require) {
var
zrender
=
require
(
'
zrender
'
);
var
zrUtil
=
require
(
'
zrender/core/util
'
);
var
each
=
zrUtil
.
each
;
var
VISUAL_CODING_STAGES
=
[
'
echarts
'
,
'
chart
'
,
'
component
'
];
// TODO Transform first or filter first
...
...
@@ -110,6 +112,10 @@ define(function (require) {
// PENDING
option
=
zrUtil
.
clone
(
option
,
true
);
each
(
optionPreprocessorFuncs
,
function
(
preProcess
)
{
preProcess
(
option
);
})
var
ecModel
=
this
.
_model
;
if
(
!
ecModel
||
notMerge
)
{
ecModel
=
new
GlobalModel
(
option
,
null
,
this
.
_theme
);
...
...
@@ -162,11 +168,7 @@ define(function (require) {
this
.
_coordinateSystem
.
update
(
ecModel
,
this
.
_extensionAPI
);
this
.
_doLayout
(
ecModel
,
payload
);
this
.
_doVisualCoding
(
ecModel
);
this
.
_doRender
(
ecModel
,
payload
);
this
.
updateView
(
payload
);
// Set background
this
.
_dom
.
style
.
backgroundColor
=
ecModel
.
get
(
'
backgroundColor
'
);
...
...
@@ -208,7 +210,7 @@ define(function (require) {
var
actionWrap
=
actions
[
payload
.
type
];
if
(
actionWrap
)
{
actionWrap
.
action
(
payload
,
this
.
_model
);
this
[
actionWrap
.
update
||
'
update
'
](
payload
);
this
[
actionWrap
.
actionInfo
.
update
||
'
update
'
](
payload
);
}
},
...
...
@@ -318,8 +320,8 @@ define(function (require) {
* @private
*/
_processData
:
function
(
ecModel
)
{
zrUtil
.
each
(
PROCESSOR_STAGES
,
function
(
stage
)
{
zrUtil
.
each
(
dataProcessorFuncs
[
stage
]
||
[],
function
(
process
)
{
each
(
PROCESSOR_STAGES
,
function
(
stage
)
{
each
(
dataProcessorFuncs
[
stage
]
||
[],
function
(
process
)
{
process
(
ecModel
);
});
});
...
...
@@ -351,10 +353,10 @@ define(function (require) {
*/
_doLayout
:
function
(
ecModel
,
event
)
{
var
api
=
this
.
_extensionAPI
;
zrUtil
.
each
(
this
.
_layouts
,
function
(
layout
)
{
each
(
this
.
_layouts
,
function
(
layout
)
{
layout
.
update
(
ecModel
,
api
,
event
);
});
zrUtil
.
each
(
layoutFuncs
,
function
(
layout
)
{
each
(
layoutFuncs
,
function
(
layout
)
{
layout
(
ecModel
,
api
,
event
);
});
},
...
...
@@ -366,8 +368,8 @@ define(function (require) {
* @private
*/
_doVisualCoding
:
function
(
ecModel
)
{
zrUtil
.
each
(
VISUAL_CODING_STAGES
,
function
(
stage
)
{
zrUtil
.
each
(
visualCodingFuncs
[
stage
]
||
[],
function
(
visualCoding
)
{
each
(
VISUAL_CODING_STAGES
,
function
(
stage
)
{
each
(
visualCodingFuncs
[
stage
]
||
[],
function
(
visualCoding
)
{
visualCoding
(
ecModel
);
});
});
...
...
@@ -379,7 +381,7 @@ define(function (require) {
_doRender
:
function
(
ecModel
,
event
)
{
var
api
=
this
.
_extensionAPI
;
// Render all components
zrUtil
.
each
(
this
.
_componentsList
,
function
(
component
)
{
each
(
this
.
_componentsList
,
function
(
component
)
{
var
componentModel
=
component
.
__model
;
component
.
render
(
componentModel
,
ecModel
,
api
,
event
);
...
...
@@ -392,7 +394,7 @@ define(function (require) {
});
},
this
);
zrUtil
.
each
(
this
.
_chartsList
,
function
(
chart
)
{
each
(
this
.
_chartsList
,
function
(
chart
)
{
chart
.
__keepAlive
=
false
;
},
this
);
...
...
@@ -413,7 +415,7 @@ define(function (require) {
},
this
);
// Remove groups of charts
zrUtil
.
each
(
this
.
_chartsList
,
function
(
chart
)
{
each
(
this
.
_chartsList
,
function
(
chart
)
{
if
(
!
chart
.
__keepAlive
)
{
chart
.
remove
(
ecModel
,
api
);
}
...
...
@@ -421,10 +423,10 @@ define(function (require) {
},
dispose
:
function
()
{
zrUtil
.
each
(
this
.
_components
,
function
(
component
)
{
each
(
this
.
_components
,
function
(
component
)
{
component
.
dispose
();
});
zrUtil
.
each
(
this
.
_charts
,
function
(
chart
)
{
each
(
this
.
_charts
,
function
(
chart
)
{
chart
.
dispose
();
});
...
...
@@ -458,6 +460,12 @@ define(function (require) {
*/
var
dataProcessorFuncs
=
{};
/**
* @type {Array.<Function>}
* @inner
*/
var
optionPreprocessorFuncs
=
[];
/**
* Visual coding functions of each stage
* @type {Array.<Object.<string, Function>>}
...
...
@@ -479,6 +487,14 @@ define(function (require) {
return
new
ECharts
(
dom
,
theme
,
opts
);
},
/**
* Register option preprocessor
* @param {Function} preprocessorFunc
*/
registerPreprocessor
:
function
(
preprocessorFunc
)
{
optionPreprocessorFuncs
.
push
(
preprocessorFunc
);
},
/**
* @param {string} stage
* @param {Function} processorFunc
...
...
@@ -587,5 +603,7 @@ define(function (require) {
echarts
.
registerVisualCoding
(
'
echarts
'
,
require
(
'
./visual/defaultColor
'
));
echarts
.
registerPreprocessor
(
require
(
'
./preprocessor/backwardCompat
'
));
return
echarts
;
});
\ No newline at end of file
src/preprocessor/backwardCompat.js
0 → 100644
浏览文件 @
387f8fd4
// Compatitable with 2.0
define
(
function
(
require
)
{
var
zrUtil
=
require
(
'
zrender/core/util
'
);
var
POSSIBLE_STYLES
=
[
'
areaStyle
'
,
'
lineStyle
'
,
'
nodeStyle
'
,
'
linkStyle
'
,
'
chordStyle
'
,
'
label
'
];
var
each
=
zrUtil
.
each
;
function
compatItemStyle
(
opt
)
{
var
itemStyleOpt
=
opt
.
itemStyle
;
if
(
itemStyleOpt
)
{
each
(
POSSIBLE_STYLES
,
function
(
styleName
)
{
var
normalItemStyleOpt
=
itemStyleOpt
.
normal
;
var
emphasisItemStyleOpt
=
itemStyleOpt
.
emphasis
;
opt
[
styleName
]
=
opt
[
styleName
]
||
{
};
if
(
normalItemStyleOpt
&&
normalItemStyleOpt
[
styleName
])
{
if
(
!
opt
[
styleName
].
normal
)
{
opt
[
styleName
].
normal
=
normalItemStyleOpt
[
styleName
];
}
else
{
zrUtil
.
merge
(
opt
[
styleName
].
normal
,
normalItemStyleOpt
[
styleName
]);
}
normalItemStyleOpt
[
styleName
]
=
null
;
}
if
(
emphasisItemStyleOpt
&&
emphasisItemStyleOpt
[
styleName
])
{
if
(
!
opt
[
styleName
].
emphasis
)
{
opt
[
styleName
].
emphasis
=
emphasisItemStyleOpt
[
styleName
];
}
else
{
zrUtil
.
merge
(
opt
[
styleName
].
emphasis
,
emphasisItemStyleOpt
[
styleName
]);
}
emphasisItemStyleOpt
[
styleName
]
=
null
;
}
});
}
}
function
compatMapSeries
(
opt
)
{
}
return
function
(
option
)
{
zrUtil
.
each
(
option
.
series
,
function
(
seriesOpt
)
{
compatItemStyle
(
seriesOpt
);
var
data
=
seriesOpt
.
data
;
if
(
data
)
{
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
compatItemStyle
(
data
[
i
]);
}
}
});
}
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录