Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
f5d2d429
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,体验更适合开发者的 AI 搜索 >>
提交
f5d2d429
编写于
3月 25, 2014
作者:
K
kener
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
主题预览升级
上级
5da4c54a
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
71 addition
and
57 deletion
+71
-57
doc/asset/js/echartsTheme.js
doc/asset/js/echartsTheme.js
+59
-27
doc/example/theme.html
doc/example/theme.html
+2
-2
doc/example/theme/blue.js
doc/example/theme/blue.js
+1
-4
doc/example/theme/dark.js
doc/example/theme/dark.js
+2
-5
doc/example/theme/erik.js
doc/example/theme/erik.js
+0
-3
doc/example/theme/gray.js
doc/example/theme/gray.js
+2
-5
doc/example/theme/green.js
doc/example/theme/green.js
+3
-6
doc/example/theme/red.js
doc/example/theme/red.js
+2
-5
未找到文件。
doc/asset/js/echartsTheme.js
浏览文件 @
f5d2d429
var
myChart
=
[];
var
domCode
=
document
.
getElementById
(
'
sidebar-code
'
);
var
domGraphic
=
document
.
getElementById
(
'
graphic
'
);
var
domMain
=
$
(
"
[md='main']
"
);
var
needRefresh
=
false
;
var
theme
=
'
erik
'
;
$
(
'
[name=theme-select]
'
).
on
(
'
change
'
,
function
(){
selectChange
(
this
.
value
);});
function
selectChange
(
value
){
window
.
location
.
hash
=
value
;
theme
=
value
;
showLoading
();
$
(
'
[name=theme-select]
'
).
val
(
theme
);
require
([
'
theme/
'
+
theme
],
function
(
curTheme
){
theme
=
curTheme
;
setTimeout
(
refreshAll
,
500
);
})
}
function
showLoading
()
{
for
(
var
i
=
0
,
l
=
domMain
.
length
;
i
<
l
;
i
++
)
{
myChart
[
i
].
showLoading
();
}
}
function
refreshAll
()
{
for
(
var
i
=
0
,
l
=
domMain
.
length
;
i
<
l
;
i
++
)
{
//
myChart[i].setTheme(theme);
myChart
[
i
].
setTheme
(
theme
);
}
}
...
...
@@ -49,10 +65,17 @@ else {
});
}
var
hash
=
window
.
location
.
hash
.
replace
(
'
#
'
,
''
)
||
'
default
'
;
if
(
$
(
'
[name=theme-select]
'
).
val
(
hash
).
val
()
!=
hash
)
{
$
(
'
[name=theme-select]
'
).
val
(
'
erik
'
);
hash
=
'
erik
'
;
}
// 按需加载
require
(
[
'
echarts
'
,
'
theme/
'
+
hash
,
'
echarts/chart/line
'
,
'
echarts/chart/bar
'
,
'
echarts/chart/scatter
'
,
...
...
@@ -68,10 +91,10 @@ require(
var
echarts
;
function
requireCallback
(
ec
)
{
function
requireCallback
(
ec
,
defaultTheme
)
{
echarts
=
ec
;
for
(
var
i
=
0
,
l
=
domMain
.
length
;
i
<
l
;
i
++
)
{
myChart
[
i
]
=
echarts
.
init
(
domMain
[
i
]);
myChart
[
i
]
=
echarts
.
init
(
domMain
[
i
]
,
defaultTheme
);
myChart
[
i
].
setOption
(
option
[
i
]);
}
...
...
@@ -89,8 +112,8 @@ function requireCallback (ec) {
var
zrDom
=
document
.
createElement
(
'
div
'
);
zrDom
.
style
.
position
=
'
absolute
'
;
zrDom
.
style
.
left
=
'
-4000px
'
;
zrDom
.
style
.
width
=
domGWidth
*
2
+
'
px
'
;
zrDom
.
style
.
height
=
(
domGHeight
/
2
)
+
'
px
'
;
zrDom
.
style
.
width
=
domGWidth
+
'
px
'
;
zrDom
.
style
.
height
=
domGHeight
+
'
px
'
;
document
.
body
.
appendChild
(
zrDom
);
var
_zr
=
require
(
'
zrender
'
).
init
(
zrDom
);
...
...
@@ -112,8 +135,8 @@ function requireCallback (ec) {
_zr
.
addShape
({
shape
:
'
image
'
,
style
:
{
x
:
domMain
[
i
].
offsetLeft
-
domGLeft
+
(
i
<
6
?
0
:
domGWidth
)
,
y
:
domMain
[
i
].
offsetTop
-
domGTop
-
(
i
<
6
?
0
:
1200
)
,
x
:
domMain
[
i
].
offsetLeft
-
domGLeft
,
y
:
domMain
[
i
].
offsetTop
-
domGTop
,
image
:
myChart
[
i
].
getDataURL
()
}
});
...
...
@@ -172,11 +195,11 @@ function requireCallback (ec) {
}
var
theme
;
var
option
=
{
0
:
{
title
:
{
text
:
'
折线图
'
text
:
'
折线图
'
,
subtext
:
'
ECharts
'
},
tooltip
:
{
trigger
:
'
axis
'
...
...
@@ -206,10 +229,10 @@ var option = {
],
series
:
[
{
name
:
'
成交
'
,
name
:
'
意向
'
,
type
:
'
line
'
,
smooth
:
true
,
data
:[
1
0
,
12
,
21
,
54
,
260
,
830
,
71
0
]
data
:[
1
320
,
1132
,
601
,
234
,
120
,
90
,
2
0
]
},
{
name
:
'
预购
'
,
...
...
@@ -218,16 +241,17 @@ var option = {
data
:[
30
,
182
,
434
,
791
,
390
,
30
,
10
]
},
{
name
:
'
意向
'
,
name
:
'
成交
'
,
type
:
'
line
'
,
smooth
:
true
,
data
:[
1
320
,
1132
,
601
,
234
,
120
,
90
,
2
0
]
data
:[
1
0
,
12
,
21
,
54
,
260
,
830
,
71
0
]
}
]
},
1
:
{
title
:
{
text
:
'
柱形图
'
text
:
'
柱形图
'
,
subtext
:
'
ECharts
'
},
legend
:
{
data
:[
'
直接
'
,
'
邮件
'
,
'
联盟
'
,
'
搜索
'
]
...
...
@@ -261,12 +285,12 @@ var option = {
{
name
:
'
直接
'
,
type
:
'
bar
'
,
data
:[
120
,
132
,
201
,
234
,
290
,
230
,
22
0
]
data
:[
80
,
132
,
101
,
134
,
90
,
180
,
20
0
]
},
{
name
:
'
邮件
'
,
type
:
'
bar
'
,
data
:[
80
,
102
,
101
,
134
,
90
,
230
,
21
0
]
data
:[
120
,
102
,
151
,
164
,
230
,
230
,
28
0
]
},
{
name
:
'
联盟
'
,
...
...
@@ -282,7 +306,8 @@ var option = {
},
2
:
{
title
:
{
text
:
'
散点图
'
text
:
'
散点图
'
,
subtext
:
'
ECharts
'
},
tooltip
:
{
trigger
:
'
item
'
,
...
...
@@ -442,7 +467,8 @@ var option = {
},
3
:
{
title
:
{
text
:
'
K线图
'
text
:
'
K线图
'
,
subtext
:
'
ECharts
'
},
tooltip
:
{
trigger
:
'
axis
'
,
...
...
@@ -609,7 +635,8 @@ var option = {
},
4
:
{
title
:
{
text
:
'
地图
'
text
:
'
地图
'
,
subtext
:
'
ECharts
'
},
tooltip
:
{
trigger
:
'
item
'
...
...
@@ -626,6 +653,7 @@ var option = {
dataRange
:
{
min
:
0
,
max
:
100000
,
realtime
:
false
,
calculable
:
true
},
series
:
[
...
...
@@ -817,7 +845,8 @@ var option = {
},
5
:
{
title
:
{
text
:
'
饼图
'
text
:
'
饼图
'
,
subtext
:
'
ECharts
'
},
tooltip
:
{
trigger
:
'
item
'
,
...
...
@@ -861,7 +890,8 @@ var option = {
},
6
:
{
title
:
{
text
:
'
雷达图
'
text
:
'
雷达图
'
,
subtext
:
'
ECharts
'
},
tooltip
:
{
trigger
:
'
axis
'
...
...
@@ -911,7 +941,8 @@ var option = {
},
7
:
{
title
:
{
text
:
'
和弦图
'
text
:
'
和弦图
'
,
subtext
:
'
ECharts
'
},
tooltip
:
{
trigger
:
'
item
'
...
...
@@ -1011,7 +1042,8 @@ var option = {
return
{
title
:
{
text
:
'
力导向布局图
'
text
:
'
力导向布局图
'
,
subtext
:
'
ECharts
'
},
tooltip
:
{
trigger
:
'
item
'
,
...
...
@@ -1048,4 +1080,4 @@ var option = {
]
}
})()
};
\ No newline at end of file
};
doc/example/theme.html
浏览文件 @
f5d2d429
...
...
@@ -71,7 +71,7 @@
<div
class=
"row-fluid"
>
<div
class=
'span8'
>
<select
style=
"width:100%"
name=
"theme-select"
>
<option
selected=
"true"
name=
'
default'
>
default
</option>
<option
selected=
"true"
name=
'
erik'
>
erik
</option>
<option
name=
'blue'
>
blue
</option>
<option
name=
'dark'
>
dark
</option>
<option
name=
'gray'
>
gray
</option>
...
...
@@ -127,7 +127,7 @@
<div
class=
"row-fluid"
>
<div
class=
'span8'
>
<select
style=
"width:100%"
name=
"theme-select"
>
<option
selected=
"true"
name=
'
default'
>
default
</option>
<option
selected=
"true"
name=
'
erik'
>
erik
</option>
<option
name=
'blue'
>
blue
</option>
<option
name=
'dark'
>
dark
</option>
<option
name=
'gray'
>
gray
</option>
...
...
doc/example/theme/blue.js
浏览文件 @
f5d2d429
...
...
@@ -5,7 +5,7 @@ var theme = {
backgroundColor
:
'
#FFF
'
,
// 默认色板
color
:
[
'
#1
bb2d8
'
,
'
#1790cf
'
,
color
:
[
'
#1
790cf
'
,
'
#1bb2d8
'
,
'
#99d2dd
'
,
'
#88b0bb
'
,
'
#1c7099
'
,
'
#038cc4
'
,
'
#75abd0
'
,
'
#afd6dd
'
],
// 图表标题
...
...
@@ -466,9 +466,6 @@ var theme = {
pie
:
{
center
:
[
'
50%
'
,
'
50%
'
],
// 默认全局居中
radius
:
[
0
,
'
75%
'
],
clockWise
:
false
,
// 默认逆时针
startAngle
:
90
,
minAngle
:
0
,
// 最小角度改为0
selectedOffset
:
10
,
// 选中是扇区偏移量
itemStyle
:
{
normal
:
{
...
...
doc/example/theme/dark.js
浏览文件 @
f5d2d429
...
...
@@ -466,15 +466,12 @@ var theme = {
pie
:
{
center
:
[
'
50%
'
,
'
50%
'
],
// 默认全局居中
radius
:
[
0
,
'
75%
'
],
clockWise
:
false
,
// 默认逆时针
startAngle
:
90
,
minAngle
:
0
,
// 最小角度改为0
selectedOffset
:
10
,
// 选中是扇区偏移量
itemStyle
:
{
normal
:
{
// color: 各异,
borderColor
:
'
#fff
'
,
borderWidth
:
1
,
borderWidth
:
0
,
label
:
{
show
:
true
,
position
:
'
outer
'
...
...
@@ -611,7 +608,7 @@ var theme = {
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
},
lineStyle
:
{
width
:
1
,
width
:
0
,
color
:
'
#fff
'
},
chordStyle
:
{
...
...
doc/example/theme/erik.js
浏览文件 @
f5d2d429
...
...
@@ -466,9 +466,6 @@ var theme = {
pie
:
{
center
:
[
'
50%
'
,
'
50%
'
],
// 默认全局居中
radius
:
[
0
,
'
75%
'
],
clockWise
:
false
,
// 默认逆时针
startAngle
:
90
,
minAngle
:
0
,
// 最小角度改为0
selectedOffset
:
10
,
// 选中是扇区偏移量
itemStyle
:
{
normal
:
{
...
...
doc/example/theme/gray.js
浏览文件 @
f5d2d429
...
...
@@ -158,8 +158,8 @@ var theme = {
// height: {number}, // 指定高度,纵向布局时默认为根据grid参数适配
backgroundColor
:
'
rgba(0,0,0,0)
'
,
// 背景颜色
dataBackgroundColor
:
'
#eee
'
,
// 数据背景颜色
fillerColor
:
'
rgba(
144,197,237
,0.2)
'
,
// 填充颜色
handleColor
:
'
rgba(
70,130,18
0,0.8)
'
// 手柄颜色
fillerColor
:
'
rgba(
80,80,80
,0.2)
'
,
// 填充颜色
handleColor
:
'
rgba(
170,170,17
0,0.8)
'
// 手柄颜色
},
// 网格
...
...
@@ -466,9 +466,6 @@ var theme = {
pie
:
{
center
:
[
'
50%
'
,
'
50%
'
],
// 默认全局居中
radius
:
[
0
,
'
75%
'
],
clockWise
:
false
,
// 默认逆时针
startAngle
:
90
,
minAngle
:
0
,
// 最小角度改为0
selectedOffset
:
10
,
// 选中是扇区偏移量
itemStyle
:
{
normal
:
{
...
...
doc/example/theme/green.js
浏览文件 @
f5d2d429
...
...
@@ -5,7 +5,7 @@ var theme = {
backgroundColor
:
'
#fff
'
,
// 默认色板
color
:
[
'
#
68a54a
'
,
'
#408829
'
,
color
:
[
'
#
408829
'
,
'
#68a54a
'
,
'
#a9cba2
'
,
'
#86b379
'
,
'
#397b29
'
,
'
#8abb6f
'
,
'
#759c6a
'
,
'
#bfd3b7
'
],
// 图表标题
...
...
@@ -158,8 +158,8 @@ var theme = {
// height: {number}, // 指定高度,纵向布局时默认为根据grid参数适配
backgroundColor
:
'
rgba(0,0,0,0)
'
,
// 背景颜色
dataBackgroundColor
:
'
#eee
'
,
// 数据背景颜色
fillerColor
:
'
rgba(144,
197,23
7,0.2)
'
,
// 填充颜色
handleColor
:
'
rgba(
70,130,18
0,0.8)
'
// 手柄颜色
fillerColor
:
'
rgba(144,
237,19
7,0.2)
'
,
// 填充颜色
handleColor
:
'
rgba(
50,160,5
0,0.8)
'
// 手柄颜色
},
// 网格
...
...
@@ -466,9 +466,6 @@ var theme = {
pie
:
{
center
:
[
'
50%
'
,
'
50%
'
],
// 默认全局居中
radius
:
[
0
,
'
75%
'
],
clockWise
:
false
,
// 默认逆时针
startAngle
:
90
,
minAngle
:
0
,
// 最小角度改为0
selectedOffset
:
10
,
// 选中是扇区偏移量
itemStyle
:
{
normal
:
{
...
...
doc/example/theme/red.js
浏览文件 @
f5d2d429
...
...
@@ -158,8 +158,8 @@ var theme = {
// height: {number}, // 指定高度,纵向布局时默认为根据grid参数适配
backgroundColor
:
'
rgba(0,0,0,0)
'
,
// 背景颜色
dataBackgroundColor
:
'
#eee
'
,
// 数据背景颜色
fillerColor
:
'
rgba(
144,197,237
,0.2)
'
,
// 填充颜色
handleColor
:
'
rgba(
70,130,1
80,0.8)
'
// 手柄颜色
fillerColor
:
'
rgba(
237,140,140
,0.2)
'
,
// 填充颜色
handleColor
:
'
rgba(
190,80,
80,0.8)
'
// 手柄颜色
},
// 网格
...
...
@@ -466,9 +466,6 @@ var theme = {
pie
:
{
center
:
[
'
50%
'
,
'
50%
'
],
// 默认全局居中
radius
:
[
0
,
'
75%
'
],
clockWise
:
false
,
// 默认逆时针
startAngle
:
90
,
minAngle
:
0
,
// 最小角度改为0
selectedOffset
:
10
,
// 选中是扇区偏移量
itemStyle
:
{
normal
:
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录