Commit f6365c1c by BellCodeEditor

save project

parent b1fad5f3
Showing with 228 additions and 64 deletions
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
</head> </head>
<body> <body>
<div id="3773000abfbb47d1afc8a1ec9d26cd10" class="chart-container" style="width:900px; height:500px;"></div> <div id="28dfccd8a023474a865e87df2a95a1d0" class="chart-container" style="width:900px; height:500px;"></div>
<script> <script>
var chart_3773000abfbb47d1afc8a1ec9d26cd10 = echarts.init( var chart_28dfccd8a023474a865e87df2a95a1d0 = echarts.init(
document.getElementById('3773000abfbb47d1afc8a1ec9d26cd10'), 'white', {renderer: 'canvas'}); document.getElementById('28dfccd8a023474a865e87df2a95a1d0'), 'white', {renderer: 'canvas'});
var option_3773000abfbb47d1afc8a1ec9d26cd10 = { var option_28dfccd8a023474a865e87df2a95a1d0 = {
"animation": true, "animation": true,
"animationThreshold": 2000, "animationThreshold": 2000,
"animationDuration": 1000, "animationDuration": 1000,
...@@ -48,71 +48,227 @@ ...@@ -48,71 +48,227 @@
], ],
"series": [ "series": [
{ {
"type": "bar", "type": "line",
"name": "\u671f\u4e2d", "name": "\u806a\u806a",
"legendHoverLink": true, "connectNulls": false,
"data": [ "symbolSize": 4,
92, "showSymbol": true,
95, "smooth": false,
82,
88
],
"showBackground": false,
"barWidth": 40,
"barMinHeight": 0,
"barCategoryGap": "20%",
"barGap": "30%",
"large": false,
"largeThreshold": 400,
"seriesLayoutBy": "column",
"datasetIndex": 0,
"clip": true, "clip": true,
"zlevel": 0, "step": false,
"z": 2, "data": [
[
"\u7b2c1\u6b21",
112
],
[
"\u7b2c2\u6b21",
110
],
[
"\u7b2c3\u6b21",
118
],
[
"\u7b2c4\u6b21",
124
],
[
"\u7b2c5\u6b21",
129
],
[
"\u7b2c6\u6b21",
132
],
[
"\u7b2c7\u6b21",
136
],
[
"\u7b2c8\u6b21",
139
],
[
"\u7b2c9\u6b21",
144
],
[
"\u7b2c10\u6b21",
143
]
],
"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
}, },
{ {
"type": "bar", "type": "line",
"name": "\u671f\u672b", "name": "\u5c0f\u6770",
"legendHoverLink": true, "connectNulls": false,
"data": [ "symbolSize": 4,
95, "showSymbol": true,
79, "smooth": false,
93,
90
],
"showBackground": false,
"barWidth": 40,
"barMinHeight": 0,
"barCategoryGap": "20%",
"barGap": "30%",
"large": false,
"largeThreshold": 400,
"seriesLayoutBy": "column",
"datasetIndex": 0,
"clip": true, "clip": true,
"step": false,
"data": [
[
"\u7b2c1\u6b21",
128
],
[
"\u7b2c2\u6b21",
131
],
[
"\u7b2c3\u6b21",
132
],
[
"\u7b2c4\u6b21",
129
],
[
"\u7b2c5\u6b21",
130
],
[
"\u7b2c6\u6b21",
127
],
[
"\u7b2c7\u6b21",
129
],
[
"\u7b2c8\u6b21",
131
],
[
"\u7b2c9\u6b21",
132
],
[
"\u7b2c10\u6b21",
128
]
],
"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": "\u76ae\u76ae",
"connectNulls": false,
"symbolSize": 4,
"showSymbol": true,
"smooth": false,
"clip": true,
"step": false,
"data": [
[
"\u7b2c1\u6b21",
143
],
[
"\u7b2c2\u6b21",
145
],
[
"\u7b2c3\u6b21",
140
],
[
"\u7b2c4\u6b21",
133
],
[
"\u7b2c5\u6b21",
134
],
[
"\u7b2c6\u6b21",
126
],
[
"\u7b2c7\u6b21",
121
],
[
"\u7b2c8\u6b21",
120
],
[
"\u7b2c9\u6b21",
114
],
[
"\u7b2c10\u6b21",
105
]
],
"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", "\u806a\u806a",
"\u671f\u672b" "\u5c0f\u6770",
"\u76ae\u76ae"
], ],
"selected": { "selected": {
"\u671f\u4e2d": true, "\u806a\u806a": true,
"\u671f\u672b": true "\u5c0f\u6770": true,
"\u76ae\u76ae": true
} }
} }
], ],
...@@ -155,10 +311,16 @@ ...@@ -155,10 +311,16 @@
} }
}, },
"data": [ "data": [
"\u6d48\u6d48", "\u7b2c1\u6b21",
"\u806a\u806a", "\u7b2c2\u6b21",
"\u5c0f\u667a", "\u7b2c3\u6b21",
"\u6ce2\u5947" "\u7b2c4\u6b21",
"\u7b2c5\u6b21",
"\u7b2c6\u6b21",
"\u7b2c7\u6b21",
"\u7b2c8\u6b21",
"\u7b2c9\u6b21",
"\u7b2c10\u6b21"
] ]
} }
], ],
...@@ -186,7 +348,7 @@ ...@@ -186,7 +348,7 @@
} }
] ]
}; };
chart_3773000abfbb47d1afc8a1ec9d26cd10.setOption(option_3773000abfbb47d1afc8a1ec9d26cd10); chart_28dfccd8a023474a865e87df2a95a1d0.setOption(option_28dfccd8a023474a865e87df2a95a1d0);
</script> </script>
</body> </body>
</html> </html>
from pyecharts.charts import Bar from pyecharts.charts import Line
subjects = ["浈浈", "聪聪", "小智", "波奇"] test = ["第1次","第2次","第3次","第4次","第5次","第6次","第7次","第8次","第9次","第10次"]
scores1 = [92, 95, 82, 88] student1 = [112, 110, 118, 124, 129, 132, 136, 139, 144, 143] # 聪聪
scores2 = [95, 79, 93, 90] student2 = [128, 131, 132, 129, 130, 127, 129, 131, 132, 128] # 小杰
bar=Bar() student3 = [143, 145, 140, 133, 134, 126, 121, 120, 114, 105] # 皮皮
bar.add_xaxis(subjects) Line=Line()
bar.add_yaxis("期中",scores1,bar_width=40) Line.add_xaxis(test)
bar.add_yaxis("期末",scores2,bar_width=40) Line.add_yaxis("聪聪",student1)
bar.render("123.html") Line.add_yaxis("小杰",student2)
\ No newline at end of file Line.add_yaxis("皮皮",student3)
Line.render("123.html")
\ No newline at end of file
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