Commit 34f47bf7 by BellCodeEditor

save project

parent 21a2db5b
Showing with 114 additions and 47 deletions
from pyecharts.charts import Bar from pyecharts import options as opts
pie=Bar() from pyecharts.charts import Map
subjects = ["语文","数学","英语","地理","历史","政治","生物","化学","物理"] import random
scores = [88, 95, 96, 94, 62, 66, 64, 93, 89]
bar.add_xaxis(subjects) province = ['广东', '湖北', '湖南', '四川', '重庆', '黑龙江', '浙江', '山西', '河北', '安徽', '河南', '山东', '西藏']
bar.add_yaxis("科目の分数",scores) data = [(i, random.randint(50, 150)) for i in province]
bar.render()
\ No newline at end of file _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()
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
</head> </head>
<body> <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> <script>
var chart_5549a307b73b4f0bbfa8e691ed3e3fd3 = echarts.init( var chart_88157172aef545a2acc18c37aae227c4 = echarts.init(
document.getElementById('5549a307b73b4f0bbfa8e691ed3e3fd3'), 'white', {renderer: 'canvas'}); document.getElementById('88157172aef545a2acc18c37aae227c4'), 'white', {renderer: 'canvas'});
var option_5549a307b73b4f0bbfa8e691ed3e3fd3 = { var option_88157172aef545a2acc18c37aae227c4 = {
"animation": true, "animation": true,
"animationThreshold": 2000, "animationThreshold": 2000,
"animationDuration": 1000, "animationDuration": 1000,
...@@ -48,45 +48,107 @@ ...@@ -48,45 +48,107 @@
], ],
"series": [ "series": [
{ {
"type": "bar", "type": "line",
"name": "\u79d1\u76ee\u306e\u5206\u6570", "name": "\u671f\u4e2d",
"legendHoverLink": true, "connectNulls": false,
"symbolSize": 4,
"showSymbol": true,
"smooth": false,
"clip": true,
"step": false,
"data": [ "data": [
88, [
95, "\u6d48\u6d48",
96, 92
94,
62,
66,
64,
93,
89
], ],
"showBackground": false, [
"barMinHeight": 0, "\u806a\u806a",
"barCategoryGap": "20%", 85
"barGap": "30%", ],
"large": false, [
"largeThreshold": 400, "\u5c0f\u667a",
"seriesLayoutBy": "column", 82
"datasetIndex": 0, ],
"clip": true, [
"\u6ce2\u5947",
88
]
],
"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, "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": { "label": {
"show": true, "show": true,
"position": "top", "position": "top",
"margin": 8 "margin": 8
} },
"lineStyle": {
"show": true,
"width": 1,
"opacity": 1,
"curveness": 0,
"type": "solid"
},
"areaStyle": {
"opacity": 0
},
"zlevel": 0,
"z": 0
} }
], ],
"legend": [ "legend": [
{ {
"data": [ "data": [
"\u79d1\u76ee\u306e\u5206\u6570" "\u671f\u4e2d",
"\u671f\u672b"
], ],
"selected": { "selected": {
"\u79d1\u76ee\u306e\u5206\u6570": true "\u671f\u4e2d": true,
"\u671f\u672b": true
} }
} }
], ],
...@@ -129,15 +191,10 @@ ...@@ -129,15 +191,10 @@
} }
}, },
"data": [ "data": [
"\u8bed\u6587", "\u6d48\u6d48",
"\u6570\u5b66", "\u806a\u806a",
"\u82f1\u8bed", "\u5c0f\u667a",
"\u5730\u7406", "\u6ce2\u5947"
"\u5386\u53f2",
"\u653f\u6cbb",
"\u751f\u7269",
"\u5316\u5b66",
"\u7269\u7406"
] ]
} }
], ],
...@@ -165,7 +222,7 @@ ...@@ -165,7 +222,7 @@
} }
] ]
}; };
chart_5549a307b73b4f0bbfa8e691ed3e3fd3.setOption(option_5549a307b73b4f0bbfa8e691ed3e3fd3); chart_88157172aef545a2acc18c37aae227c4.setOption(option_88157172aef545a2acc18c37aae227c4);
</script> </script>
</body> </body>
</html> </html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment