Commit 5bc6e935 by BellCodeEditor

save project

parent 54d9cd84
Showing with 49 additions and 26 deletions
from pyecharts.charts import Bar
bar = Bar()
subjects = ["语文","数学","英语","地理","历史","政治","生物","化学","物理"]
scores = [88, 95, 96, 94, 62, 66, 64, 93, 89]
bar.add_xaxis(subjects)
bar.add_yaxis("得分",scores)
studens_name = ["真真","匆匆","吱吱","麒麒"]
scores = [88, 95, 96, 94]
scores2 = [98,79,93,90]
bar.add_xaxis(studens_name)
bar.add_yaxis("期中分数",scores,bar_width=40)
bar.add_yaxis("期末分数",scores2,bar_width=40)
bar.render('zhuzhuangtu.html')
......@@ -7,11 +7,11 @@
</head>
<body>
<div id="dc8a4b18e8e7493aab3d7e631485af98" class="chart-container" style="width:900px; height:500px;"></div>
<div id="c563ecab3f2b44a685703ac3e2a94796" class="chart-container" style="width:900px; height:500px;"></div>
<script>
var chart_dc8a4b18e8e7493aab3d7e631485af98 = echarts.init(
document.getElementById('dc8a4b18e8e7493aab3d7e631485af98'), 'white', {renderer: 'canvas'});
var option_dc8a4b18e8e7493aab3d7e631485af98 = {
var chart_c563ecab3f2b44a685703ac3e2a94796 = echarts.init(
document.getElementById('c563ecab3f2b44a685703ac3e2a94796'), 'white', {renderer: 'canvas'});
var option_c563ecab3f2b44a685703ac3e2a94796 = {
"animation": true,
"animationThreshold": 2000,
"animationDuration": 1000,
......@@ -49,20 +49,44 @@
"series": [
{
"type": "bar",
"name": "\u5f97\u5206",
"name": "\u671f\u4e2d\u5206\u6570",
"legendHoverLink": true,
"data": [
88,
95,
96,
94,
62,
66,
64,
94
],
"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": {
"show": true,
"position": "top",
"margin": 8
}
},
{
"type": "bar",
"name": "\u671f\u672b\u5206\u6570",
"legendHoverLink": true,
"data": [
98,
79,
93,
89
90
],
"showBackground": false,
"barWidth": 40,
"barMinHeight": 0,
"barCategoryGap": "20%",
"barGap": "30%",
......@@ -83,10 +107,12 @@
"legend": [
{
"data": [
"\u5f97\u5206"
"\u671f\u4e2d\u5206\u6570",
"\u671f\u672b\u5206\u6570"
],
"selected": {
"\u5f97\u5206": true
"\u671f\u4e2d\u5206\u6570": true,
"\u671f\u672b\u5206\u6570": true
}
}
],
......@@ -129,15 +155,10 @@
}
},
"data": [
"\u8bed\u6587",
"\u6570\u5b66",
"\u82f1\u8bed",
"\u5730\u7406",
"\u5386\u53f2",
"\u653f\u6cbb",
"\u751f\u7269",
"\u5316\u5b66",
"\u7269\u7406"
"\u771f\u771f",
"\u5306\u5306",
"\u5431\u5431",
"\u9e92\u9e92"
]
}
],
......@@ -165,7 +186,7 @@
}
]
};
chart_dc8a4b18e8e7493aab3d7e631485af98.setOption(option_dc8a4b18e8e7493aab3d7e631485af98);
chart_c563ecab3f2b44a685703ac3e2a94796.setOption(option_c563ecab3f2b44a685703ac3e2a94796);
</script>
</body>
</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