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
34f47bf7
authored
Dec 05, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
21a2db5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
114 additions
and
47 deletions
my_analysis.py
render.html
my_analysis.py
View file @
34f47bf7
from
pyecharts.charts
import
Bar
pie
=
Bar
()
subjects
=
[
"语文"
,
"数学"
,
"英语"
,
"地理"
,
"历史"
,
"政治"
,
"生物"
,
"化学"
,
"物理"
]
scores
=
[
88
,
95
,
96
,
94
,
62
,
66
,
64
,
93
,
89
]
bar
.
add_xaxis
(
subjects
)
bar
.
add_yaxis
(
"科目の分数"
,
scores
)
bar
.
render
()
\ No newline at end of file
from
pyecharts
import
options
as
opts
from
pyecharts.charts
import
Map
import
random
province
=
[
'广东'
,
'湖北'
,
'湖南'
,
'四川'
,
'重庆'
,
'黑龙江'
,
'浙江'
,
'山西'
,
'河北'
,
'安徽'
,
'河南'
,
'山东'
,
'西藏'
]
data
=
[(
i
,
random
.
randint
(
50
,
150
))
for
i
in
province
]
_map
=
(
Map
()
.
add
(
"销售额"
,
data
,
"china"
)
.
set_global_opts
(
title_opts
=
opts
.
TitleOpts
(
title
=
"Map-基本示例"
),
legend_opts
=
opts
.
LegendOpts
(
is_show
=
False
),
visualmap_opts
=
opts
.
VisualMapOpts
(
max_
=
200
,
is_piecewise
=
True
),
)
)
_map
.
render_notebook
()
render.html
View file @
34f47bf7
...
...
@@ -7,11 +7,11 @@
</head>
<body>
<div
id=
"
5549a307b73b4f0bbfa8e691ed3e3fd3
"
class=
"chart-container"
style=
"width:900px; height:500px;"
></div>
<div
id=
"
88157172aef545a2acc18c37aae227c4
"
class=
"chart-container"
style=
"width:900px; height:500px;"
></div>
<script>
var
chart_
5549a307b73b4f0bbfa8e691ed3e3fd3
=
echarts
.
init
(
document
.
getElementById
(
'
5549a307b73b4f0bbfa8e691ed3e3fd3
'
),
'white'
,
{
renderer
:
'canvas'
});
var
option_
5549a307b73b4f0bbfa8e691ed3e3fd3
=
{
var
chart_
88157172aef545a2acc18c37aae227c4
=
echarts
.
init
(
document
.
getElementById
(
'
88157172aef545a2acc18c37aae227c4
'
),
'white'
,
{
renderer
:
'canvas'
});
var
option_
88157172aef545a2acc18c37aae227c4
=
{
"animation"
:
true
,
"animationThreshold"
:
2000
,
"animationDuration"
:
1000
,
...
...
@@ -48,45 +48,107 @@
],
"series"
:
[
{
"type"
:
"bar"
,
"name"
:
"\u79d1\u76ee\u306e\u5206\u6570"
,
"legendHoverLink"
:
true
,
"type"
:
"line"
,
"name"
:
"\u671f\u4e2d"
,
"connectNulls"
:
false
,
"symbolSize"
:
4
,
"showSymbol"
:
true
,
"smooth"
:
false
,
"clip"
:
true
,
"step"
:
false
,
"data"
:
[
88
,
95
,
96
,
94
,
62
,
66
,
64
,
93
,
89
[
"\u6d48\u6d48"
,
92
],
[
"\u806a\u806a"
,
85
],
[
"\u5c0f\u667a"
,
82
],
[
"\u6ce2\u5947"
,
88
]
],
"showBackground"
:
false
,
"barMinHeight"
:
0
,
"barCategoryGap"
:
"20%"
,
"barGap"
:
"30%"
,
"large"
:
false
,
"largeThreshold"
:
400
,
"seriesLayoutBy"
:
"column"
,
"datasetIndex"
:
0
,
"clip"
:
true
,
"hoverAnimation"
:
true
,
"label"
:
{
"show"
:
true
,
"position"
:
"top"
,
"margin"
:
8
},
"lineStyle"
:
{
"show"
:
true
,
"width"
:
1
,
"opacity"
:
1
,
"curveness"
:
0
,
"type"
:
"solid"
},
"areaStyle"
:
{
"opacity"
:
0
},
"zlevel"
:
0
,
"z"
:
2
,
"z"
:
0
},
{
"type"
:
"line"
,
"name"
:
"\u671f\u672b"
,
"connectNulls"
:
false
,
"symbolSize"
:
4
,
"showSymbol"
:
true
,
"smooth"
:
false
,
"clip"
:
true
,
"step"
:
false
,
"data"
:
[
[
"\u6d48\u6d48"
,
95
],
[
"\u806a\u806a"
,
79
],
[
"\u5c0f\u667a"
,
93
],
[
"\u6ce2\u5947"
,
90
]
],
"hoverAnimation"
:
true
,
"label"
:
{
"show"
:
true
,
"position"
:
"top"
,
"margin"
:
8
}
},
"lineStyle"
:
{
"show"
:
true
,
"width"
:
1
,
"opacity"
:
1
,
"curveness"
:
0
,
"type"
:
"solid"
},
"areaStyle"
:
{
"opacity"
:
0
},
"zlevel"
:
0
,
"z"
:
0
}
],
"legend"
:
[
{
"data"
:
[
"\u79d1\u76ee\u306e\u5206\u6570"
"\u671f\u4e2d"
,
"\u671f\u672b"
],
"selected"
:
{
"\u79d1\u76ee\u306e\u5206\u6570"
:
true
"\u671f\u4e2d"
:
true
,
"\u671f\u672b"
:
true
}
}
],
...
...
@@ -129,15 +191,10 @@
}
},
"data"
:
[
"\u8bed\u6587"
,
"\u6570\u5b66"
,
"\u82f1\u8bed"
,
"\u5730\u7406"
,
"\u5386\u53f2"
,
"\u653f\u6cbb"
,
"\u751f\u7269"
,
"\u5316\u5b66"
,
"\u7269\u7406"
"\u6d48\u6d48"
,
"\u806a\u806a"
,
"\u5c0f\u667a"
,
"\u6ce2\u5947"
]
}
],
...
...
@@ -165,7 +222,7 @@
}
]
};
chart_
5549a307b73b4f0bbfa8e691ed3e3fd3
.
setOption
(
option_5549a307b73b4f0bbfa8e691ed3e3fd3
);
chart_
88157172aef545a2acc18c37aae227c4
.
setOption
(
option_88157172aef545a2acc18c37aae227c4
);
</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