Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson24-diy3
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
884e6e42
authored
Oct 15, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
57025ed7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
29 deletions
XXX.html
my_analysis.py
XXX.html
View file @
884e6e42
...
...
@@ -7,11 +7,11 @@
</head>
<body>
<div
id=
"
6f9c3131db8f47a4a59cb1c378befd1a
"
class=
"chart-container"
style=
"width:900px; height:500px;"
></div>
<div
id=
"
96e181158616470fa998603d0d2b37ae
"
class=
"chart-container"
style=
"width:900px; height:500px;"
></div>
<script>
var
chart_
6f9c3131db8f47a4a59cb1c378befd1a
=
echarts
.
init
(
document
.
getElementById
(
'
6f9c3131db8f47a4a59cb1c378befd1a
'
),
'white'
,
{
renderer
:
'canvas'
});
var
option_
6f9c3131db8f47a4a59cb1c378befd1a
=
{
var
chart_
96e181158616470fa998603d0d2b37ae
=
echarts
.
init
(
document
.
getElementById
(
'
96e181158616470fa998603d0d2b37ae
'
),
'white'
,
{
renderer
:
'canvas'
});
var
option_
96e181158616470fa998603d0d2b37ae
=
{
"animation"
:
true
,
"animationThreshold"
:
2000
,
"animationDuration"
:
1000
,
...
...
@@ -21,6 +21,9 @@
"animationEasingUpdate"
:
"cubicOut"
,
"animationDelayUpdate"
:
0
,
"color"
:
[
"yellow"
,
"blue"
,
"red"
,
"#c23531"
,
"#2f4554"
,
"#61a0a8"
,
...
...
@@ -49,7 +52,7 @@
"series"
:
[
{
"type"
:
"line"
,
"name"
:
"\u
6210\u7ee9
"
,
"name"
:
"\u
806a\u806a
"
,
"connectNulls"
:
false
,
"symbolSize"
:
4
,
"showSymbol"
:
true
,
...
...
@@ -119,7 +122,7 @@
},
{
"type"
:
"line"
,
"name"
:
"\u
6210\u7ee9
"
,
"name"
:
"\u
5c0f\u6770
"
,
"connectNulls"
:
false
,
"symbolSize"
:
4
,
"showSymbol"
:
true
,
...
...
@@ -189,7 +192,7 @@
},
{
"type"
:
"line"
,
"name"
:
"\u
6210\u7ee9
"
,
"name"
:
"\u
76ae\u76ae
"
,
"connectNulls"
:
false
,
"symbolSize"
:
4
,
"showSymbol"
:
true
,
...
...
@@ -261,12 +264,14 @@
"legend"
:
[
{
"data"
:
[
"\u
6210\u7ee9
"
,
"\u
6210\u7ee9
"
,
"\u
6210\u7ee9
"
"\u
806a\u806a
"
,
"\u
5c0f\u6770
"
,
"\u
76ae\u76ae
"
],
"selected"
:
{
"\u6210\u7ee9"
:
true
"\u806a\u806a"
:
true
,
"\u5c0f\u6770"
:
true
,
"\u76ae\u76ae"
:
true
},
"show"
:
true
,
"padding"
:
5
,
...
...
@@ -351,11 +356,10 @@
}
],
"title"
:
{
"text"
:
"\u6210\u7ee9"
,
"subteat"
:
"\u5206"
"text"
:
"\u6210\u7ee9\u8d70\u52bf\u56fe"
}
};
chart_
6f9c3131db8f47a4a59cb1c378befd1a
.
setOption
(
option_6f9c3131db8f47a4a59cb1c378befd1a
);
chart_
96e181158616470fa998603d0d2b37ae
.
setOption
(
option_96e181158616470fa998603d0d2b37ae
);
</script>
</body>
</html>
my_analysis.py
View file @
884e6e42
from
pyecharts.charts
import
Line
#
from pyecharts.charts import Line
test
=
[
"第1次"
,
"第2次"
,
"第3次"
,
"第4次"
,
"第5次"
,
"第6次"
,
"第7次"
,
"第8次"
,
"第9次"
,
"第10次"
]
student1
=
[
112
,
110
,
118
,
124
,
129
,
132
,
136
,
139
,
144
,
143
]
# 聪聪
student2
=
[
128
,
131
,
132
,
129
,
130
,
127
,
129
,
131
,
132
,
128
]
# 小杰
student3
=
[
143
,
145
,
140
,
133
,
134
,
126
,
121
,
120
,
114
,
105
]
# 皮皮
#
test = ["第1次","第2次","第3次","第4次","第5次","第6次","第7次","第8次","第9次","第10次"]
#
student1 = [112, 110, 118, 124, 129, 132, 136, 139, 144, 143] # 聪聪
#
student2 = [128, 131, 132, 129, 130, 127, 129, 131, 132, 128] # 小杰
#
student3 = [143, 145, 140, 133, 134, 126, 121, 120, 114, 105] # 皮皮
#创建对应的图表对象
line
=
Line
()
#传入x轴和y轴的数据
line
.
add_xaxis
(
test
)
line
.
add_yaxis
(
"成绩"
,
student1
)
line
.
add_yaxis
(
"成绩"
,
student2
)
line
.
add_yaxis
(
"成绩"
,
student3
)
line
.
set_global_opts
(
title_opts
=
{
"text"
:
"成绩"
,
"subteat"
:
"分
"
})
#保存到本地文件
line
.
render
(
"XXX
.html"
)
#
#
创建对应的图表对象
#
line=Line()
#
#
传入x轴和y轴的数据
#
line.add_xaxis(test)
# line.add_yaxis("聪聪",student1,color="red"
)
# line.add_yaxis("小杰",student2,color="blue"
)
# line.add_yaxis("皮皮",student3,color="yellow"
)
# line.set_global_opts(title_opts={"text":"成绩走势图
"})
#
#
保存到本地文件
# line.render("XXXxxx
.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