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
052a4f1a
authored
Mar 23, 2025
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
377b1a41
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
10 deletions
123.html
my_analysis.py
123.html
View file @
052a4f1a
...
...
@@ -7,11 +7,11 @@
</head>
<body>
<div
id=
"
20d70b2eb07e4f4f92c7da5ddddb3ba9
"
class=
"chart-container"
style=
"width:900px; height:500px;"
></div>
<div
id=
"
6f7ff7e1d8984b4aaef8dc641a6dca77
"
class=
"chart-container"
style=
"width:900px; height:500px;"
></div>
<script>
var
chart_
20d70b2eb07e4f4f92c7da5ddddb3ba9
=
echarts
.
init
(
document
.
getElementById
(
'
20d70b2eb07e4f4f92c7da5ddddb3ba9
'
),
'white'
,
{
renderer
:
'canvas'
});
var
option_
20d70b2eb07e4f4f92c7da5ddddb3ba9
=
{
var
chart_
6f7ff7e1d8984b4aaef8dc641a6dca77
=
echarts
.
init
(
document
.
getElementById
(
'
6f7ff7e1d8984b4aaef8dc641a6dca77
'
),
'white'
,
{
renderer
:
'canvas'
});
var
option_
6f7ff7e1d8984b4aaef8dc641a6dca77
=
{
"animation"
:
true
,
"animationThreshold"
:
2000
,
"animationDuration"
:
1000
,
...
...
@@ -49,7 +49,7 @@
"series"
:
[
{
"type"
:
"bar"
,
"name"
:
"\u
8d1e\u8d1e\u540c\u5b66\u7684
\u6210\u7ee9"
,
"name"
:
"\u
671f\u4e2d\u8003\u8bd5
\u6210\u7ee9"
,
"legendHoverLink"
:
true
,
"data"
:
[
88
,
...
...
@@ -63,6 +63,40 @@
89
],
"showBackground"
:
false
,
"barWidth"
:
40
,
"barMinHeight"
:
0
,
"barCategoryGap"
:
"20%"
,
"barGap"
:
"30%"
,
"large"
:
false
,
"largeThreshold"
:
400
,
"seriesLayoutBy"
:
"column"
,
"datasetIndex"
:
0
,
"clip"
:
true
,
"zlevel"
:
0
,
"z"
:
2
,
"label"
:
{
"show"
:
true
,
"position"
:
"top"
,
"margin"
:
8
}
},
{
"type"
:
"bar"
,
"name"
:
"\u671f\u672b\u8003\u8bd5\u6210\u7ee9"
,
"legendHoverLink"
:
true
,
"data"
:
[
90
,
92
,
98
,
91
,
78
,
69
,
71
,
96
,
83
],
"showBackground"
:
false
,
"barWidth"
:
40
,
"barMinHeight"
:
0
,
"barCategoryGap"
:
"20%"
,
"barGap"
:
"30%"
,
...
...
@@ -83,10 +117,12 @@
"legend"
:
[
{
"data"
:
[
"\u8d1e\u8d1e\u540c\u5b66\u7684\u6210\u7ee9"
"\u671f\u4e2d\u8003\u8bd5\u6210\u7ee9"
,
"\u671f\u672b\u8003\u8bd5\u6210\u7ee9"
],
"selected"
:
{
"\u8d1e\u8d1e\u540c\u5b66\u7684\u6210\u7ee9"
:
true
"\u671f\u4e2d\u8003\u8bd5\u6210\u7ee9"
:
true
,
"\u671f\u672b\u8003\u8bd5\u6210\u7ee9"
:
true
}
}
],
...
...
@@ -165,7 +201,7 @@
}
]
};
chart_
20d70b2eb07e4f4f92c7da5ddddb3ba9
.
setOption
(
option_20d70b2eb07e4f4f92c7da5ddddb3ba9
);
chart_
6f7ff7e1d8984b4aaef8dc641a6dca77
.
setOption
(
option_6f7ff7e1d8984b4aaef8dc641a6dca77
);
</script>
</body>
</html>
my_analysis.py
View file @
052a4f1a
from
pyecharts.charts
import
Bar
bar
=
Bar
()
subjects
=
[
"语文"
,
"数学"
,
"英语"
,
"地理"
,
"历史"
,
"政治"
,
"生物"
,
"化学"
,
"物理"
]
scores
=
[
88
,
95
,
96
,
94
,
62
,
66
,
64
,
93
,
89
]
scores1
=
[
88
,
95
,
96
,
94
,
62
,
66
,
64
,
93
,
89
]
scores2
=
[
90
,
92
,
98
,
91
,
78
,
69
,
71
,
96
,
83
]
bar
.
add_xaxis
(
subjects
)
bar
.
add_yaxis
(
"贞贞同学的成绩"
,
scores
)
bar
.
add_yaxis
(
"期中考试成绩"
,
scores1
,
bar_width
=
40
)
bar
.
add_yaxis
(
"期末考试成绩"
,
scores2
,
bar_width
=
40
)
bar
.
render
(
"123.html"
)
\ No newline at end of file
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