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
46e8e586
authored
Dec 24, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
9dc680c7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
69 deletions
my_analysis.py
render.html
my_analysis.py
View file @
46e8e586
from
pyecharts
import
charts
bar
=
charts
.
Bar
()
subjects
=
[
"浈浈"
,
"聪聪"
,
"小智"
,
"波奇"
]
scores1
=
[
92
,
95
,
82
,
88
]
# 期中成绩
scores2
=
[
95
,
79
,
93
,
90
]
# 期末成绩
bar
.
add_xaxis
(
subjects
)
bar
.
add_yaxis
(
"期中"
,
scores1
,
bar_width
=
40
)
bar
.
add_yaxis
(
"期末"
,
scores2
,
bar_width
=
40
,
color
=
"warmred"
)
bar
.
render
()
\ No newline at end of file
line
=
charts
.
Line
()
subjects
=
[
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"10"
,
"11"
,
"12"
]
scores1
=
[
2.6
,
5.9
,
9.0
,
26.4
,
28.7
,
76.7
,
175.6
,
182.2
,
48.7
,
18.8
,
6.0
,
2.3
]
# 期中成绩
line
.
add_xaxis
(
subjects
)
line
.
add_yaxis
(
"期中"
,
scores1
)
line
.
render
()
\ No newline at end of file
render.html
View file @
46e8e586
...
...
@@ -7,11 +7,11 @@
</head>
<body>
<div
id=
"
caa21caa86774f4cb8d2b3c09cc6892
a"
class=
"chart-container"
style=
"width:900px; height:500px;"
></div>
<div
id=
"
6f100848bc3044448c5dcdb5d458186
a"
class=
"chart-container"
style=
"width:900px; height:500px;"
></div>
<script>
var
chart_
caa21caa86774f4cb8d2b3c09cc6892
a
=
echarts
.
init
(
document
.
getElementById
(
'
caa21caa86774f4cb8d2b3c09cc6892
a'
),
'white'
,
{
renderer
:
'canvas'
});
var
option_
caa21caa86774f4cb8d2b3c09cc6892
a
=
{
var
chart_
6f100848bc3044448c5dcdb5d458186
a
=
echarts
.
init
(
document
.
getElementById
(
'
6f100848bc3044448c5dcdb5d458186
a'
),
'white'
,
{
renderer
:
'canvas'
});
var
option_
6f100848bc3044448c5dcdb5d458186
a
=
{
"animation"
:
true
,
"animationThreshold"
:
2000
,
"animationDuration"
:
1000
,
...
...
@@ -21,7 +21,6 @@
"animationEasingUpdate"
:
"cubicOut"
,
"animationDelayUpdate"
:
0
,
"color"
:
[
"warmred"
,
"#c23531"
,
"#2f4554"
,
"#61a0a8"
,
...
...
@@ -49,71 +48,91 @@
],
"series"
:
[
{
"type"
:
"
bar
"
,
"type"
:
"
line
"
,
"name"
:
"\u671f\u4e2d"
,
"legendHoverLink"
:
true
,
"data"
:
[
92
,
95
,
82
,
88
],
"showBackground"
:
false
,
"barWidth"
:
40
,
"barMinHeight"
:
0
,
"barCategoryGap"
:
"20%"
,
"barGap"
:
"30%"
,
"large"
:
false
,
"largeThreshold"
:
400
,
"seriesLayoutBy"
:
"column"
,
"datasetIndex"
:
0
,
"connectNulls"
:
false
,
"symbolSize"
:
4
,
"showSymbol"
:
true
,
"smooth"
:
false
,
"clip"
:
true
,
"zlevel"
:
0
,
"z"
:
2
,
"step"
:
false
,
"data"
:
[
[
"1"
,
2.6
],
[
"2"
,
5.9
],
[
"3"
,
9.0
],
[
"4"
,
26.4
],
[
"5"
,
28.7
],
[
"6"
,
76.7
],
[
"7"
,
175.6
],
[
"8"
,
182.2
],
[
"9"
,
48.7
],
[
"10"
,
18.8
],
[
"11"
,
6.0
],
[
"12"
,
2.3
]
],
"hoverAnimation"
:
true
,
"label"
:
{
"show"
:
true
,
"position"
:
"top"
,
"margin"
:
8
}
},
{
"type"
:
"bar"
,
"name"
:
"\u671f\u672b"
,
"legendHoverLink"
:
true
,
"data"
:
[
95
,
79
,
93
,
90
],
"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"
:
{
"lineStyle"
:
{
"show"
:
true
,
"position"
:
"top"
,
"margin"
:
8
}
"width"
:
1
,
"opacity"
:
1
,
"curveness"
:
0
,
"type"
:
"solid"
},
"areaStyle"
:
{
"opacity"
:
0
},
"zlevel"
:
0
,
"z"
:
0
}
],
"legend"
:
[
{
"data"
:
[
"\u671f\u4e2d"
,
"\u671f\u672b"
"\u671f\u4e2d"
],
"selected"
:
{
"\u671f\u4e2d"
:
true
,
"\u671f\u672b"
:
true
"\u671f\u4e2d"
:
true
}
}
],
...
...
@@ -156,10 +175,18 @@
}
},
"data"
:
[
"\u6d48\u6d48"
,
"\u806a\u806a"
,
"\u5c0f\u667a"
,
"\u6ce2\u5947"
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"10"
,
"11"
,
"12"
]
}
],
...
...
@@ -187,7 +214,7 @@
}
]
};
chart_
caa21caa86774f4cb8d2b3c09cc6892a
.
setOption
(
option_caa21caa86774f4cb8d2b3c09cc6892
a
);
chart_
6f100848bc3044448c5dcdb5d458186a
.
setOption
(
option_6f100848bc3044448c5dcdb5d458186
a
);
</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