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
1364d875
authored
Sep 25, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
ba2435b7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
27 deletions
my_analysis.py
render.html
my_analysis.py
View file @
1364d875
from
pyecharts.charts
import
Bar
from
pyecharts.charts
import
Bar
subjects
=
[
"语文"
,
"数学"
,
"英语"
,
"地理"
,
"历史"
,
"政治"
,
"生物"
,
"化学"
,
"物理"
]
subjects
=
[
"桢桢"
,
"聪聪"
,
"小智"
,
"波奇"
]
scores
=
[
88
,
95
,
96
,
94
,
62
,
66
,
64
,
93
,
89
]
scores1
=
[
92
,
95
,
82
,
88
]
scores2
=
[
95
,
79
,
93
,
90
]
bar
=
Bar
()
bar
=
Bar
()
bar
.
add_xaxis
(
subjects
)
bar
.
add_xaxis
(
subjects
)
bar
.
add_yaxis
(
"1111111"
,
scores
)
bar
.
add_yaxis
(
"期中"
,
scores1
,
bar_width
=
40
)
bar
.
add_yaxis
(
"期末"
,
scores2
,
bar_width
=
40
)
bar
.
render
()
bar
.
render
()
\ No newline at end of file
render.html
View file @
1364d875
...
@@ -7,11 +7,11 @@
...
@@ -7,11 +7,11 @@
</head>
</head>
<body>
<body>
<div
id=
"
f6e3c67442834da08d203581b01e498c
"
class=
"chart-container"
style=
"width:900px; height:500px;"
></div>
<div
id=
"
5c31693f87e147b5af4a419ebac3d124
"
class=
"chart-container"
style=
"width:900px; height:500px;"
></div>
<script>
<script>
var
chart_
f6e3c67442834da08d203581b01e498c
=
echarts
.
init
(
var
chart_
5c31693f87e147b5af4a419ebac3d124
=
echarts
.
init
(
document
.
getElementById
(
'
f6e3c67442834da08d203581b01e498c
'
),
'white'
,
{
renderer
:
'canvas'
});
document
.
getElementById
(
'
5c31693f87e147b5af4a419ebac3d124
'
),
'white'
,
{
renderer
:
'canvas'
});
var
option_
f6e3c67442834da08d203581b01e498c
=
{
var
option_
5c31693f87e147b5af4a419ebac3d124
=
{
"animation"
:
true
,
"animation"
:
true
,
"animationThreshold"
:
2000
,
"animationThreshold"
:
2000
,
"animationDuration"
:
1000
,
"animationDuration"
:
1000
,
...
@@ -49,18 +49,40 @@
...
@@ -49,18 +49,40 @@
"series"
:
[
"series"
:
[
{
{
"type"
:
"bar"
,
"type"
:
"bar"
,
"name"
:
"
1111111
"
,
"name"
:
"
\u671f\u4e2d
"
,
"legendHoverLink"
:
true
,
"legendHoverLink"
:
true
,
"data"
:
[
"data"
:
[
88
,
92
,
95
,
95
,
96
,
82
,
94
,
88
62
,
],
66
,
"showBackground"
:
false
,
64
,
"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"
,
"legendHoverLink"
:
true
,
"data"
:
[
95
,
79
,
93
,
93
,
89
90
],
],
"showBackground"
:
false
,
"showBackground"
:
false
,
"barMinHeight"
:
0
,
"barMinHeight"
:
0
,
...
@@ -83,10 +105,12 @@
...
@@ -83,10 +105,12 @@
"legend"
:
[
"legend"
:
[
{
{
"data"
:
[
"data"
:
[
"1111111"
"\u671f\u4e2d"
,
"\u671f\u672b"
],
],
"selected"
:
{
"selected"
:
{
"1111111"
:
true
"\u671f\u4e2d"
:
true
,
"\u671f\u672b"
:
true
}
}
}
}
],
],
...
@@ -129,15 +153,10 @@
...
@@ -129,15 +153,10 @@
}
}
},
},
"data"
:
[
"data"
:
[
"\u8bed\u6587"
,
"\u6862\u6862"
,
"\u6570\u5b66"
,
"\u806a\u806a"
,
"\u82f1\u8bed"
,
"\u5c0f\u667a"
,
"\u5730\u7406"
,
"\u6ce2\u5947"
"\u5386\u53f2"
,
"\u653f\u6cbb"
,
"\u751f\u7269"
,
"\u5316\u5b66"
,
"\u7269\u7406"
]
]
}
}
],
],
...
@@ -165,7 +184,7 @@
...
@@ -165,7 +184,7 @@
}
}
]
]
};
};
chart_
f6e3c67442834da08d203581b01e498c
.
setOption
(
option_f6e3c67442834da08d203581b01e498c
);
chart_
5c31693f87e147b5af4a419ebac3d124
.
setOption
(
option_5c31693f87e147b5af4a419ebac3d124
);
</script>
</script>
</body>
</body>
</html>
</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