Commit 7ce465b4 by BellCodeEditor

save project

parent 5bc6e935
Showing with 144 additions and 59 deletions
from pyecharts.charts import Bar from pyecharts.charts import Line
bar = Line()
bar = Bar() studens_name = ["JAN","FEB","MAR","APR"]
studens_name = ["真真","匆匆","吱吱","麒麒"]
scores = [88, 95, 96, 94] scores = [88, 95, 96, 94]
scores2 = [98,79,93,90] scores2 = [18, 75, 56, 104]
scores4 = [81, 57, 86, 74]
bar.add_xaxis(studens_name) bar.add_xaxis(studens_name)
bar.add_yaxis("期中分数",scores,bar_width=40) bar.add_yaxis("ZHO",scores)
bar.add_yaxis("期末分数",scores2,bar_width=40) bar.add_yaxis("QI",scores2)
bar.add_yaxis("LI",scores4)
bar.render('zhuzhuangtu.html') bar.render('zhuzhuangtu.html')
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
</head> </head>
<body> <body>
<div id="c563ecab3f2b44a685703ac3e2a94796" class="chart-container" style="width:900px; height:500px;"></div> <div id="c11210195a594e36b46d708692212a17" class="chart-container" style="width:900px; height:500px;"></div>
<script> <script>
var chart_c563ecab3f2b44a685703ac3e2a94796 = echarts.init( var chart_c11210195a594e36b46d708692212a17 = echarts.init(
document.getElementById('c563ecab3f2b44a685703ac3e2a94796'), 'white', {renderer: 'canvas'}); document.getElementById('c11210195a594e36b46d708692212a17'), 'white', {renderer: 'canvas'});
var option_c563ecab3f2b44a685703ac3e2a94796 = { var option_c11210195a594e36b46d708692212a17 = {
"animation": true, "animation": true,
"animationThreshold": 2000, "animationThreshold": 2000,
"animationDuration": 1000, "animationDuration": 1000,
...@@ -48,71 +48,155 @@ ...@@ -48,71 +48,155 @@
], ],
"series": [ "series": [
{ {
"type": "bar", "type": "line",
"name": "\u671f\u4e2d\u5206\u6570", "name": "ZHO",
"legendHoverLink": true, "connectNulls": false,
"symbolSize": 4,
"showSymbol": true,
"smooth": false,
"clip": true,
"step": false,
"data": [ "data": [
88, [
95, "JAN",
96, 88
94 ],
[
"FEB",
95
],
[
"MAR",
96
],
[
"APR",
94
]
], ],
"showBackground": false, "hoverAnimation": true,
"barWidth": 40,
"barMinHeight": 0,
"barCategoryGap": "20%",
"barGap": "30%",
"large": false,
"largeThreshold": 400,
"seriesLayoutBy": "column",
"datasetIndex": 0,
"clip": true,
"zlevel": 0,
"z": 2,
"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
}, },
{ {
"type": "bar", "type": "line",
"name": "\u671f\u672b\u5206\u6570", "name": "QI",
"legendHoverLink": true, "connectNulls": false,
"symbolSize": 4,
"showSymbol": true,
"smooth": false,
"clip": true,
"step": false,
"data": [ "data": [
98, [
79, "JAN",
93, 18
90 ],
[
"FEB",
75
],
[
"MAR",
56
],
[
"APR",
104
]
], ],
"showBackground": false, "hoverAnimation": true,
"barWidth": 40, "label": {
"barMinHeight": 0, "show": true,
"barCategoryGap": "20%", "position": "top",
"barGap": "30%", "margin": 8
"large": false, },
"largeThreshold": 400, "lineStyle": {
"seriesLayoutBy": "column", "show": true,
"datasetIndex": 0, "width": 1,
"clip": true, "opacity": 1,
"curveness": 0,
"type": "solid"
},
"areaStyle": {
"opacity": 0
},
"zlevel": 0, "zlevel": 0,
"z": 2, "z": 0
},
{
"type": "line",
"name": "LI",
"connectNulls": false,
"symbolSize": 4,
"showSymbol": true,
"smooth": false,
"clip": true,
"step": false,
"data": [
[
"JAN",
81
],
[
"FEB",
57
],
[
"MAR",
86
],
[
"APR",
74
]
],
"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": [
"\u671f\u4e2d\u5206\u6570", "ZHO",
"\u671f\u672b\u5206\u6570" "QI",
"LI"
], ],
"selected": { "selected": {
"\u671f\u4e2d\u5206\u6570": true, "ZHO": true,
"\u671f\u672b\u5206\u6570": true "QI": true,
"LI": true
} }
} }
], ],
...@@ -155,10 +239,10 @@ ...@@ -155,10 +239,10 @@
} }
}, },
"data": [ "data": [
"\u771f\u771f", "JAN",
"\u5306\u5306", "FEB",
"\u5431\u5431", "MAR",
"\u9e92\u9e92" "APR"
] ]
} }
], ],
...@@ -186,7 +270,7 @@ ...@@ -186,7 +270,7 @@
} }
] ]
}; };
chart_c563ecab3f2b44a685703ac3e2a94796.setOption(option_c563ecab3f2b44a685703ac3e2a94796); chart_c11210195a594e36b46d708692212a17.setOption(option_c11210195a594e36b46d708692212a17);
</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