Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson24-diy1
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
70d10616
authored
Aug 22, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
bb9a99eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
31 deletions
my_analysis.py
render.html
my_analysis.py
View file @
70d10616
from
pyecharts.charts
import
Bar
subjects
=
[
"18-"
,
"18-25"
,
"26-35"
,
"35-45"
,
"50+"
]
scores1
=
[
88
,
95
,
96
,
94
,
56
]
scores2
=
[
62
,
66
,
64
,
93
]
from
pyecharts.charts
import
Bar
subjects
=
[
"浈浈"
,
"聪聪"
,
"小智"
,
"波奇"
]
scores1
=
[
92
,
95
,
82
,
88
]
scores2
=
[
95
,
79
,
93
,
90
]
bar
=
Bar
()
bar
.
add_xaxis
(
subjects
)
bar
.
add_yaxis
(
"
男"
,
scores1
)
bar
.
add_yaxis
(
"
女"
,
scores2
)
bar
.
add_yaxis
(
"
期中"
,
scores1
,
bar_width
=
50
)
bar
.
add_yaxis
(
"
期末"
,
scores2
,
bar_width
=
50
)
bar
.
render
()
\ No newline at end of file
render.html
View file @
70d10616
...
...
@@ -7,11 +7,11 @@
</head>
<body>
<div
id=
"
2f5b0170b98845c59f2b97e581090cf3
"
class=
"chart-container"
style=
"width:900px; height:500px;"
></div>
<div
id=
"
f099f4d7f0cd4769bc7c49db42e2504d
"
class=
"chart-container"
style=
"width:900px; height:500px;"
></div>
<script>
var
chart_
2f5b0170b98845c59f2b97e581090cf3
=
echarts
.
init
(
document
.
getElementById
(
'
2f5b0170b98845c59f2b97e581090cf3
'
),
'white'
,
{
renderer
:
'canvas'
});
var
option_
2f5b0170b98845c59f2b97e581090cf3
=
{
var
chart_
f099f4d7f0cd4769bc7c49db42e2504d
=
echarts
.
init
(
document
.
getElementById
(
'
f099f4d7f0cd4769bc7c49db42e2504d
'
),
'white'
,
{
renderer
:
'canvas'
});
var
option_
f099f4d7f0cd4769bc7c49db42e2504d
=
{
"animation"
:
true
,
"animationThreshold"
:
2000
,
"animationDuration"
:
1000
,
...
...
@@ -49,16 +49,16 @@
"series"
:
[
{
"type"
:
"bar"
,
"name"
:
"\u
7537
"
,
"name"
:
"\u
671f\u4e2d
"
,
"legendHoverLink"
:
true
,
"data"
:
[
88
,
92
,
95
,
96
,
94
,
56
82
,
88
],
"showBackground"
:
false
,
"barWidth"
:
50
,
"barMinHeight"
:
0
,
"barCategoryGap"
:
"20%"
,
"barGap"
:
"30%"
,
...
...
@@ -77,15 +77,16 @@
},
{
"type"
:
"bar"
,
"name"
:
"\u
5973
"
,
"name"
:
"\u
671f\u672b
"
,
"legendHoverLink"
:
true
,
"data"
:
[
62
,
66
,
64
,
9
3
95
,
79
,
93
,
9
0
],
"showBackground"
:
false
,
"barWidth"
:
50
,
"barMinHeight"
:
0
,
"barCategoryGap"
:
"20%"
,
"barGap"
:
"30%"
,
...
...
@@ -106,12 +107,12 @@
"legend"
:
[
{
"data"
:
[
"\u
7537
"
,
"\u
5973
"
"\u
671f\u4e2d
"
,
"\u
671f\u672b
"
],
"selected"
:
{
"\u
7537
"
:
true
,
"\u
5973
"
:
true
"\u
671f\u4e2d
"
:
true
,
"\u
671f\u672b
"
:
true
}
}
],
...
...
@@ -154,11 +155,10 @@
}
},
"data"
:
[
"18-"
,
"18-25"
,
"26-35"
,
"35-45"
,
"50+"
"\u6d48\u6d48"
,
"\u806a\u806a"
,
"\u5c0f\u667a"
,
"\u6ce2\u5947"
]
}
],
...
...
@@ -186,7 +186,7 @@
}
]
};
chart_
2f5b0170b98845c59f2b97e581090cf3
.
setOption
(
option_2f5b0170b98845c59f2b97e581090cf3
);
chart_
f099f4d7f0cd4769bc7c49db42e2504d
.
setOption
(
option_f099f4d7f0cd4769bc7c49db42e2504d
);
</script>
</body>
</html>
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