Commit ebe3fc93 by BellCodeEditor

save project

parent d8ce8d1c
Showing with 93 additions and 188 deletions
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
</head> </head>
<body> <body>
<div id="ebd0fd302da949968ac638687b54c58c" class="chart-container" style="width:900px; height:500px;"></div> <div id="2d623747292d40659b02c551ecb8ac2d" class="chart-container" style="width:900px; height:500px;"></div>
<script> <script>
var chart_ebd0fd302da949968ac638687b54c58c = echarts.init( var chart_2d623747292d40659b02c551ecb8ac2d = echarts.init(
document.getElementById('ebd0fd302da949968ac638687b54c58c'), 'white', {renderer: 'canvas'}); document.getElementById('2d623747292d40659b02c551ecb8ac2d'), 'white', {renderer: 'canvas'});
var option_ebd0fd302da949968ac638687b54c58c = { var option_2d623747292d40659b02c551ecb8ac2d = {
"animation": true, "animation": true,
"animationThreshold": 2000, "animationThreshold": 2000,
"animationDuration": 1000, "animationDuration": 1000,
...@@ -48,214 +48,106 @@ ...@@ -48,214 +48,106 @@
], ],
"series": [ "series": [
{ {
"type": "line", "type": "bar",
"name": "\u806a\u806a", "name": "\u806a\u806a",
"connectNulls": false, "legendHoverLink": true,
"symbolSize": 4,
"showSymbol": true,
"smooth": false,
"clip": true,
"step": false,
"data": [ "data": [
[ 112,
"\u7b2c1\u6b21", 110,
112 118,
], 124,
[ 129,
"\u7b2c2\u6b21", 132,
110 136,
], 139,
[ 144,
"\u7b2c3\u6b21", 143
118
],
[
"\u7b2c4\u6b21",
124
],
[
"\u7b2c5\u6b21",
129
],
[
"\u7b2c6\u6b21",
132
],
[
"\u7b2c7\u6b21",
136
],
[
"\u7b2c8\u6b21",
139
],
[
"\u7b2c9\u6b21",
144
],
[
"\u7b2c10\u6b21",
143
]
], ],
"hoverAnimation": true, "showBackground": false,
"barWidth": 13,
"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": "line", "type": "bar",
"name": "\u5c0f\u6770", "name": "\u5c0f\u6770",
"connectNulls": false, "legendHoverLink": true,
"symbolSize": 4,
"showSymbol": true,
"smooth": false,
"clip": true,
"step": false,
"data": [ "data": [
[ 128,
"\u7b2c1\u6b21", 131,
128 132,
], 129,
[ 130,
"\u7b2c2\u6b21", 127,
131 129,
], 131,
[ 132,
"\u7b2c3\u6b21", 128
132
],
[
"\u7b2c4\u6b21",
129
],
[
"\u7b2c5\u6b21",
130
],
[
"\u7b2c6\u6b21",
127
],
[
"\u7b2c7\u6b21",
129
],
[
"\u7b2c8\u6b21",
131
],
[
"\u7b2c9\u6b21",
132
],
[
"\u7b2c10\u6b21",
128
]
], ],
"hoverAnimation": true, "showBackground": false,
"barWidth": 13,
"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": "line", "type": "bar",
"name": "\u76ae\u76ae", "name": "\u76ae\u76ae",
"connectNulls": false, "legendHoverLink": true,
"symbolSize": 4,
"showSymbol": true,
"smooth": false,
"clip": true,
"step": false,
"data": [ "data": [
[ 143,
"\u7b2c1\u6b21", 145,
143 140,
], 133,
[ 134,
"\u7b2c2\u6b21", 126,
145 121,
], 120,
[ 114,
"\u7b2c3\u6b21", 105
140
],
[
"\u7b2c4\u6b21",
133
],
[
"\u7b2c5\u6b21",
134
],
[
"\u7b2c6\u6b21",
126
],
[
"\u7b2c7\u6b21",
121
],
[
"\u7b2c8\u6b21",
120
],
[
"\u7b2c9\u6b21",
114
],
[
"\u7b2c10\u6b21",
105
]
], ],
"hoverAnimation": true, "showBackground": false,
"barWidth": 13,
"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
} }
], ],
"legend": [ "legend": [
...@@ -357,7 +249,7 @@ ...@@ -357,7 +249,7 @@
"subtext": "\u6570\u5b66" "subtext": "\u6570\u5b66"
} }
}; };
chart_ebd0fd302da949968ac638687b54c58c.setOption(option_ebd0fd302da949968ac638687b54c58c); chart_2d623747292d40659b02c551ecb8ac2d.setOption(option_2d623747292d40659b02c551ecb8ac2d);
</script> </script>
</body> </body>
</html> </html>
from pyecharts.charts import Bar
line=Bar()
test = ["第1次","第2次","第3次","第4次","第5次","第6次","第7次","第8次","第9次","第10次"]
student1 = [112, 110, 118, 124, 129, 132, 136, 139, 144, 143] # 聪聪
student2 = [128, 131, 132, 129, 130, 127, 129, 131, 132, 128] # 小杰
student3 = [143, 145, 140, 133, 134, 126, 121, 120, 114, 105] # 皮皮
line.add_xaxis(test)
line.add_yaxis("聪聪",student1,bar_width=13)
line.add_yaxis("小杰",student2,bar_width=13)
line.add_yaxis("皮皮",student3,bar_width=13)
line.set_global_opts(title_opts={"text":"成绩走势图","subtext":"数学"})
line.render("analysis.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