Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mui
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mui
Commits
c1a1caeb
Commit
c1a1caeb
authored
Aug 11, 2015
by
hbcui1984
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加饼图
parent
74ef6d94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
6 deletions
+34
-6
examples/hello-mui/examples/echarts.html
examples/hello-mui/examples/echarts.html
+34
-6
No files found.
examples/hello-mui/examples/echarts.html
View file @
c1a1caeb
...
...
@@ -38,16 +38,39 @@
<div
class=
"chart"
id=
"barChart"
></div>
<h5>
线图示例
</h5>
<div
class=
"chart"
id=
"lineChart"
></div>
<h5>
饼图示例
</h5>
<div
class=
"chart"
id=
"pieChart"
></div>
</div>
</div>
<script
src=
"../js/mui.min.js"
></script>
<script
src=
"../libs/echarts-all.js"
></script>
<script>
var
getOption
=
function
(
chartType
)
{
var
chartOption
=
{
tooltip
:
{
trigger
:
'
axis
'
},
var
chartOption
=
chartType
==
'
pie
'
?
{
calculable
:
false
,
series
:
[{
name
:
'
访问来源
'
,
type
:
'
pie
'
,
radius
:
'
65%
'
,
center
:
[
'
50%
'
,
'
50%
'
],
data
:
[{
value
:
335
,
name
:
'
直接访问
'
},
{
value
:
310
,
name
:
'
邮件营销
'
},
{
value
:
234
,
name
:
'
联盟广告
'
},
{
value
:
135
,
name
:
'
视频广告
'
},
{
value
:
1548
,
name
:
'
搜索引擎
'
}]
}]
}
:
{
legend
:
{
data
:
[
'
蒸发量
'
,
'
降水量
'
]
},
...
...
@@ -102,10 +125,15 @@
};
return
chartOption
;
};
var
barChart
=
echarts
.
init
(
document
.
getElementById
(
'
barChart
'
));
var
byId
=
function
(
id
)
{
return
document
.
getElementById
(
id
);
};
var
barChart
=
echarts
.
init
(
byId
(
'
barChart
'
));
barChart
.
setOption
(
getOption
(
'
bar
'
));
var
lineChart
=
echarts
.
init
(
document
.
getElementB
yId
(
'
lineChart
'
));
var
lineChart
=
echarts
.
init
(
b
yId
(
'
lineChart
'
));
lineChart
.
setOption
(
getOption
(
'
line
'
));
var
pieChart
=
echarts
.
init
(
byId
(
'
pieChart
'
));
pieChart
.
setOption
(
getOption
(
'
pie
'
));
</script>
</body>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment