Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
a4e3fd75
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,发现更多精彩内容 >>
提交
a4e3fd75
编写于
3月 04, 2014
作者:
K
kener
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.3.8 release
增加图片background支持
上级
619489cc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
49 addition
and
36 deletion
+49
-36
doc/asset/js/echartsThemeDesigner.js
doc/asset/js/echartsThemeDesigner.js
+7
-2
src/component/toolbox.js
src/component/toolbox.js
+6
-1
src/config.js
src/config.js
+1
-1
src/echarts.js
src/echarts.js
+35
-32
未找到文件。
doc/asset/js/echartsThemeDesigner.js
浏览文件 @
a4e3fd75
...
...
@@ -143,6 +143,7 @@ function requireCallback (ec) {
document
.
body
.
appendChild
(
zrDom
);
var
_zr
=
require
(
'
zrender
'
).
init
(
zrDom
);
/*
_zr.addShape({
shape:'rectangle',
style : {
...
...
@@ -150,9 +151,10 @@ function requireCallback (ec) {
y : 0,
width : domGWidth * 2,
height : domGHeight / 2,
color
:
'
#fff
'
color:
theme.backgroundColor ||
'#fff'
}
});
*/
var
domGLeft
=
domG
.
offsetLeft
;
var
domGTop
=
domG
.
offsetTop
;
for
(
var
i
=
0
,
l
=
domMain
.
length
;
i
<
l
;
i
++
)
{
...
...
@@ -168,7 +170,10 @@ function requireCallback (ec) {
_zr
.
render
();
setTimeout
(
function
()
{
var
image
=
_zr
.
toDataURL
(
'
image/png
'
);
var
bgColor
=
theme
.
backgroundColor
&&
theme
.
backgroundColor
.
replace
(
'
'
,
''
)
==
'
rgba(0,0,0,0)
'
?
'
#fff
'
:
theme
.
backgroundColor
;
var
image
=
_zr
.
toDataURL
(
'
image/png
'
,
bgColor
);
_zr
.
dispose
();
zrDom
.
parentNode
.
removeChild
(
zrDom
);
zrDom
=
null
;
...
...
src/component/toolbox.js
浏览文件 @
a4e3fd75
...
...
@@ -686,7 +686,12 @@ define(function (require) {
if
(
imgType
!=
'
png
'
&&
imgType
!=
'
jpeg
'
)
{
imgType
=
'
png
'
;
}
var
image
=
zr
.
toDataURL
(
'
image/
'
+
imgType
);
var
bgColor
=
option
.
backgroundColor
&&
option
.
backgroundColor
.
replace
(
'
'
,
''
)
==
'
rgba(0,0,0,0)
'
?
'
#fff
'
:
option
.
backgroundColor
;
var
image
=
zr
.
toDataURL
(
'
image/
'
+
imgType
,
bgColor
);
var
downloadDiv
=
document
.
createElement
(
'
div
'
);
downloadDiv
.
id
=
'
__echarts_download_wrap__
'
;
downloadDiv
.
style
.
cssText
=
'
position:fixed;
'
...
...
src/config.js
浏览文件 @
a4e3fd75
...
...
@@ -37,7 +37,7 @@ define(function() {
COMPONENT_TYPE_AXIS_VALUE
:
'
valueAxis
'
,
// 全图默认背景
backgroundColor
:
'
rgba(0,0,0,0)
'
,
//
backgroundColor: 'rgba(0,0,0,0)',
// 默认色板
color
:
[
'
#ff7f50
'
,
'
#87cefa
'
,
'
#da70d6
'
,
'
#32cd32
'
,
'
#6495ed
'
,
...
...
src/echarts.js
浏览文件 @
a4e3fd75
...
...
@@ -524,6 +524,7 @@ define(function(require) {
* 图表渲染
*/
function
_render
(
magicOption
)
{
_mergeGlobalConifg
(
magicOption
);
if
(
magicOption
.
backgroundColor
)
{
if
(
!
_canvasSupported
&&
magicOption
.
backgroundColor
.
indexOf
(
'
rgba
'
)
!=
-
1
...
...
@@ -843,58 +844,58 @@ define(function(require) {
/**
* 非图表全局属性merge~~
*/
function
_mergeGlobalConifg
()
{
function
_mergeGlobalConifg
(
magicOption
)
{
// 背景
if
(
typeof
_o
ption
.
backgroundColor
==
'
undefined
'
)
{
_o
ption
.
backgroundColor
=
_themeConfig
.
backgroundColor
;
if
(
typeof
magicO
ption
.
backgroundColor
==
'
undefined
'
)
{
magicO
ption
.
backgroundColor
=
_themeConfig
.
backgroundColor
;
}
// 拖拽重计算相关
if
(
typeof
_o
ption
.
calculable
==
'
undefined
'
)
{
_o
ption
.
calculable
=
_themeConfig
.
calculable
;
if
(
typeof
magicO
ption
.
calculable
==
'
undefined
'
)
{
magicO
ption
.
calculable
=
_themeConfig
.
calculable
;
}
if
(
typeof
_o
ption
.
calculableColor
==
'
undefined
'
)
{
_o
ption
.
calculableColor
=
_themeConfig
.
calculableColor
;
if
(
typeof
magicO
ption
.
calculableColor
==
'
undefined
'
)
{
magicO
ption
.
calculableColor
=
_themeConfig
.
calculableColor
;
}
if
(
typeof
_o
ption
.
calculableHolderColor
==
'
undefined
'
)
{
_o
ption
.
calculableHolderColor
=
_themeConfig
.
calculableHolderColor
;
if
(
typeof
magicO
ption
.
calculableHolderColor
==
'
undefined
'
)
{
magicO
ption
.
calculableHolderColor
=
_themeConfig
.
calculableHolderColor
;
}
// 孤岛显示连接符
if
(
typeof
_o
ption
.
nameConnector
==
'
undefined
'
)
{
_o
ption
.
nameConnector
=
_themeConfig
.
nameConnector
;
if
(
typeof
magicO
ption
.
nameConnector
==
'
undefined
'
)
{
magicO
ption
.
nameConnector
=
_themeConfig
.
nameConnector
;
}
if
(
typeof
_o
ption
.
valueConnector
==
'
undefined
'
)
{
_o
ption
.
valueConnector
=
_themeConfig
.
valueConnector
;
if
(
typeof
magicO
ption
.
valueConnector
==
'
undefined
'
)
{
magicO
ption
.
valueConnector
=
_themeConfig
.
valueConnector
;
}
// 动画相关
if
(
typeof
_o
ption
.
animation
==
'
undefined
'
)
{
_o
ption
.
animation
=
_themeConfig
.
animation
;
if
(
typeof
magicO
ption
.
animation
==
'
undefined
'
)
{
magicO
ption
.
animation
=
_themeConfig
.
animation
;
}
if
(
typeof
_o
ption
.
animationThreshold
==
'
undefined
'
)
{
_o
ption
.
animationThreshold
=
_themeConfig
.
animationThreshold
;
if
(
typeof
magicO
ption
.
animationThreshold
==
'
undefined
'
)
{
magicO
ption
.
animationThreshold
=
_themeConfig
.
animationThreshold
;
}
if
(
typeof
_o
ption
.
animationDuration
==
'
undefined
'
)
{
_o
ption
.
animationDuration
=
_themeConfig
.
animationDuration
;
if
(
typeof
magicO
ption
.
animationDuration
==
'
undefined
'
)
{
magicO
ption
.
animationDuration
=
_themeConfig
.
animationDuration
;
}
if
(
typeof
_o
ption
.
animationEasing
==
'
undefined
'
)
{
_o
ption
.
animationEasing
=
_themeConfig
.
animationEasing
;
if
(
typeof
magicO
ption
.
animationEasing
==
'
undefined
'
)
{
magicO
ption
.
animationEasing
=
_themeConfig
.
animationEasing
;
}
if
(
typeof
_o
ption
.
addDataAnimation
==
'
undefined
'
)
{
_o
ption
.
addDataAnimation
=
_themeConfig
.
addDataAnimation
;
if
(
typeof
magicO
ption
.
addDataAnimation
==
'
undefined
'
)
{
magicO
ption
.
addDataAnimation
=
_themeConfig
.
addDataAnimation
;
}
// 默认标志图形类型列表
if
(
typeof
_o
ption
.
symbolList
==
'
undefined
'
)
{
_o
ption
.
symbolList
=
_themeConfig
.
symbolList
;
if
(
typeof
magicO
ption
.
symbolList
==
'
undefined
'
)
{
magicO
ption
.
symbolList
=
_themeConfig
.
symbolList
;
}
var
zrColor
=
require
(
'
zrender/tool/color
'
);
// 数值系列的颜色列表,不传则采用内置颜色,可配数组,借用zrender实例注入,会有冲突风险,先这样
if
(
_option
.
color
&&
_o
ption
.
color
.
length
>
0
)
{
if
(
magicOption
.
color
&&
magicO
ption
.
color
.
length
>
0
)
{
_zr
.
getColor
=
function
(
idx
)
{
return
zrColor
.
getColor
(
idx
,
_o
ption
.
color
);
return
zrColor
.
getColor
(
idx
,
magicO
ption
.
color
);
};
}
else
{
...
...
@@ -904,8 +905,8 @@ define(function(require) {
}
// 降低图表内元素拖拽敏感度,单位ms,不建议外部干预
if
(
typeof
_o
ption
.
DRAG_ENABLE_TIME
==
'
undefined
'
)
{
_o
ption
.
DRAG_ENABLE_TIME
=
_themeConfig
.
DRAG_ENABLE_TIME
;
if
(
typeof
magicO
ption
.
DRAG_ENABLE_TIME
==
'
undefined
'
)
{
magicO
ption
.
DRAG_ENABLE_TIME
=
_themeConfig
.
DRAG_ENABLE_TIME
;
}
}
...
...
@@ -935,8 +936,6 @@ define(function(require) {
return
;
}
_mergeGlobalConifg
();
_optionBackup
=
zrUtil
.
clone
(
_option
);
_optionRestore
=
zrUtil
.
clone
(
_option
);
...
...
@@ -1203,7 +1202,10 @@ define(function(require) {
if
(
imgType
!=
'
png
'
&&
imgType
!=
'
jpeg
'
)
{
imgType
=
'
png
'
;
}
return
_zr
.
toDataURL
(
'
image/
'
+
imgType
);
var
bgColor
=
_option
.
backgroundColor
&&
_option
.
backgroundColor
.
replace
(
'
'
,
''
)
==
'
rgba(0,0,0,0)
'
?
'
#fff
'
:
_option
.
backgroundColor
;
return
_zr
.
toDataURL
(
'
image/
'
+
imgType
,
bgColor
);
}
/**
...
...
@@ -1331,6 +1333,7 @@ define(function(require) {
_themeConfig
.
textStyle
.
fontFamily
=
_themeConfig
.
textStyle
.
fontFamily2
;
}
_optionRestore
&&
self
.
restore
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录