Commit 0609f759 by BellCodeEditor

save project

parent 12e480ba
Showing with 54 additions and 24 deletions
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
</head> </head>
<body> <body>
<div id="8abaec4c06714d27bd1dddc704c780ad" class="chart-container" style="width:900px; height:500px;"></div> <div id="a9d2ec89f1534257a209774a5c1b0343" class="chart-container" style="width:900px; height:500px;"></div>
<script> <script>
var chart_8abaec4c06714d27bd1dddc704c780ad = echarts.init( var chart_a9d2ec89f1534257a209774a5c1b0343 = echarts.init(
document.getElementById('8abaec4c06714d27bd1dddc704c780ad'), 'white', {renderer: 'canvas'}); document.getElementById('a9d2ec89f1534257a209774a5c1b0343'), 'white', {renderer: 'canvas'});
var option_8abaec4c06714d27bd1dddc704c780ad = { var option_a9d2ec89f1534257a209774a5c1b0343 = {
"animation": true, "animation": true,
"animationThreshold": 2000, "animationThreshold": 2000,
"animationDuration": 1000, "animationDuration": 1000,
...@@ -49,20 +49,44 @@ ...@@ -49,20 +49,44 @@
"series": [ "series": [
{ {
"type": "bar", "type": "bar",
"name": "\u9488\u9488\u7684\u6210\u7ee9", "name": "\u671f\u4e2d",
"legendHoverLink": true, "legendHoverLink": true,
"data": [ "data": [
88, 92,
95, 95,
96, 82,
94, 88
62, ],
66, "showBackground": false,
64, "barWidth": 40,
"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,
"barWidth": 40,
"barMinHeight": 0, "barMinHeight": 0,
"barCategoryGap": "20%", "barCategoryGap": "20%",
"barGap": "30%", "barGap": "30%",
...@@ -83,10 +107,12 @@ ...@@ -83,10 +107,12 @@
"legend": [ "legend": [
{ {
"data": [ "data": [
"\u9488\u9488\u7684\u6210\u7ee9" "\u671f\u4e2d",
"\u671f\u672b"
], ],
"selected": { "selected": {
"\u9488\u9488\u7684\u6210\u7ee9": true "\u671f\u4e2d": true,
"\u671f\u672b": true
} }
} }
], ],
...@@ -129,15 +155,10 @@ ...@@ -129,15 +155,10 @@
} }
}, },
"data": [ "data": [
"\u8bed\u6587", "\u73cd\u73cd",
"\u6570\u5b66", "\u806a\u806a",
"\u82f1\u8bed", "\u5c0f\u667a",
"\u5730\u7406", "\u6ce2\u5947"
"\u5386\u53f2",
"\u653f\u6cbb",
"\u751f\u7269",
"\u5316\u5b66",
"\u7269\u7406"
] ]
} }
], ],
...@@ -165,7 +186,7 @@ ...@@ -165,7 +186,7 @@
} }
] ]
}; };
chart_8abaec4c06714d27bd1dddc704c780ad.setOption(option_8abaec4c06714d27bd1dddc704c780ad); chart_a9d2ec89f1534257a209774a5c1b0343.setOption(option_a9d2ec89f1534257a209774a5c1b0343);
</script> </script>
</body> </body>
</html> </html>
from pyecharts.charts import Bar
subjects=["珍珍","聪聪","小智","波奇"]
scores1=[92,95,82,88]
scores2=[95,79,93,90]
bar=Bar()
bar.add_xaxis(subjects)
bar.add_yaxis("期中",scores1,bar_width=40)
bar.add_yaxis("期末",scores2,bar_width=40)
bar.render("analysis.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