Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
alon@wen
echarts
提交
cc6d2c41
E
echarts
项目概览
alon@wen
/
echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cc6d2c41
编写于
8月 20, 2015
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Default color
上级
9cfe31fb
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
44 addition
and
10 deletion
+44
-10
src/chart/bar/BarView.js
src/chart/bar/BarView.js
+2
-4
src/echarts.js
src/echarts.js
+1
-1
src/model/Global.js
src/model/Global.js
+10
-3
src/model/Model.js
src/model/Model.js
+28
-0
src/visual/defaultColor.js
src/visual/defaultColor.js
+3
-2
未找到文件。
src/chart/bar/BarView.js
浏览文件 @
cc6d2c41
...
...
@@ -28,10 +28,8 @@ define(function (require) {
height
:
layout
.
height
},
style
:
{
fill
:
dataItem
.
withPrefix
(
'
itemStyle.normal.
'
)
.
get
(
'
color
'
),
stroke
:
dataItem
.
get
(
'
borderColor
'
)
fill
:
dataItem
.
getVisual
(
'
color
'
),
stroke
:
dataItem
.
get
(
'
itemStyle.normal.borderColor
'
)
}
});
...
...
src/echarts.js
浏览文件 @
cc6d2c41
...
...
@@ -22,7 +22,7 @@ define(function (require) {
this
.
_zr
=
zrender
.
init
(
dom
);
this
.
_theme
=
theme
;
this
.
_theme
=
zrUtil
.
clone
(
theme
)
;
this
.
_chartsList
=
[];
this
.
_chartsMap
=
{};
...
...
src/model/Global.js
浏览文件 @
cc6d2c41
...
...
@@ -27,6 +27,8 @@ define(function (require) {
init
:
function
(
option
,
parentModel
,
theme
)
{
theme
=
theme
||
{};
this
.
option
=
{};
/**
...
...
@@ -51,10 +53,11 @@ define(function (require) {
* @type {module:echarts/model/Model}
* @private
*/
this
.
_theme
=
new
Model
(
theme
||
{}
);
this
.
_theme
=
new
Model
(
theme
);
this
.
_mergeTheme
(
option
,
theme
);
// TODO Needs clone when merging to the unexisted property
zrUtil
.
merge
(
option
,
globalDefault
,
false
);
this
.
mergeOption
(
option
);
...
...
@@ -68,7 +71,9 @@ define(function (require) {
// 如果有 component model 则把具体的 merge 逻辑交给该 model 处理
if
(
!
ComponentModel
.
has
[
name
])
{
if
(
typeof
theme
[
name
]
===
'
object
'
)
{
zrUtil
.
merge
(
option
[
name
],
theme
[
name
]);
option
[
name
]
=
option
[
name
]
?
zrUtil
.
clone
(
theme
[
name
])
:
zrUtil
.
merge
(
option
[
name
],
theme
[
name
]);
}
else
{
option
[
name
]
=
theme
[
name
];
...
...
@@ -110,7 +115,9 @@ define(function (require) {
// 如果不存在对应的 component model 则直接 merge
if
(
!
ComponentModel
.
has
(
name
))
{
if
(
typeof
componentOption
===
'
object
'
)
{
componentOption
=
zrUtil
.
merge
(
option
[
name
]
||
{},
componentOption
);
option
[
name
]
=
option
[
name
]
==
null
?
zrUtil
.
clone
(
componentOption
)
:
zrUtil
.
merge
(
option
[
name
],
componentOption
);
}
else
{
option
[
name
]
=
componentOption
;
...
...
src/model/Model.js
浏览文件 @
cc6d2c41
...
...
@@ -32,6 +32,13 @@ define(function (require) {
_prefix
:
''
,
/**
* visual properties after visual coding
* @type {Object}
* @private
*/
_visual
:
null
,
/**
* Model 的初始化函数
* @param {Object} option
...
...
@@ -76,6 +83,27 @@ define(function (require) {
return
obj
;
},
/**
* Get visual property.
*/
getVisual
:
function
(
key
)
{
var
visual
=
this
.
_visual
;
var
val
=
visual
&&
visual
[
key
];
var
parentModel
=
this
.
parentModel
;
if
(
val
==
null
&&
parentModel
)
{
return
parentModel
.
getVisual
(
key
);
}
return
val
;
},
/**
* Set visual property
*/
setVisual
:
function
(
key
,
val
)
{
this
.
_visual
=
this
.
_visual
||
{};
this
.
_visual
[
key
]
=
val
;
},
restore
:
function
()
{},
// Pending
...
...
src/visual/defaultColor.js
浏览文件 @
cc6d2c41
...
...
@@ -3,8 +3,9 @@ define(function (require) {
return
function
(
ecModel
)
{
ecModel
.
eachSeries
(
function
(
seriesModel
,
idx
)
{
var
colorList
=
ecModel
.
get
(
'
color
'
);
seriesModel
.
visual
=
seriesModel
.
visual
||
{};
seriesModel
.
visual
.
color
=
seriesModel
.
get
(
'
itemStyle.normal.color
'
)
||
colorList
[
idx
];
seriesModel
.
setVisual
(
'
color
'
,
seriesModel
.
get
(
'
itemStyle.normal.color
'
)
||
colorList
[
idx
]
);
});
}
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录