Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson24-diy2
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
cfd0d642
authored
Oct 16, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
b15ddd8a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
my_analysis.py
render.html
my_analysis.py
View file @
cfd0d642
from
pyecharts.charts
import
Line
from
pyecharts.charts
import
Bar
subjects
=
[
"浈浈"
,
"聪聪"
,
"小智"
,
"波奇"
]
scores1
=
[
92
,
95
,
82
,
88
]
# 期中成绩
scores2
=
[
95
,
79
,
93
,
90
]
# 期末成绩
line
=
Line
()
line
.
add_xaxis
(
subjects
)
line
.
add_yaxis
(
scores1
)
line
.
add_yaxis
(
scores2
)
line
.
render
(
"render.html"
)
\ No newline at end of file
bar
=
Bar
()
bar
.
add_xaxis
(
subjects
)
bar
.
add_yaxis
(
"期中"
,
scores1
,
bar_width
=
40
)
bar
.
add_yaxis
(
"期末"
,
scores2
,
bar_width
=
40
)
bar
.
render
(
"render.html"
)
\ No newline at end of file
render.html
View file @
cfd0d642
...
...
@@ -7,11 +7,11 @@
</head>
<body>
<div
id=
"
a1e6ff8353c64bdeb70841dcfb78c997
"
class=
"chart-container"
style=
"width:900px; height:500px;"
></div>
<div
id=
"
e7dcda64c7b8409681ad45b38f5bd30f
"
class=
"chart-container"
style=
"width:900px; height:500px;"
></div>
<script>
var
chart_
a1e6ff8353c64bdeb70841dcfb78c997
=
echarts
.
init
(
document
.
getElementById
(
'
a1e6ff8353c64bdeb70841dcfb78c997
'
),
'white'
,
{
renderer
:
'canvas'
});
var
option_
a1e6ff8353c64bdeb70841dcfb78c997
=
{
var
chart_
e7dcda64c7b8409681ad45b38f5bd30f
=
echarts
.
init
(
document
.
getElementById
(
'
e7dcda64c7b8409681ad45b38f5bd30f
'
),
'white'
,
{
renderer
:
'canvas'
});
var
option_
e7dcda64c7b8409681ad45b38f5bd30f
=
{
"animation"
:
true
,
"animationThreshold"
:
2000
,
"animationDuration"
:
1000
,
...
...
@@ -186,7 +186,7 @@
}
]
};
chart_
a1e6ff8353c64bdeb70841dcfb78c997
.
setOption
(
option_a1e6ff8353c64bdeb70841dcfb78c997
);
chart_
e7dcda64c7b8409681ad45b38f5bd30f
.
setOption
(
option_e7dcda64c7b8409681ad45b38f5bd30f
);
</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