Commit 884e6e42 by BellCodeEditor

save project

parent 57025ed7
Showing with 33 additions and 29 deletions
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
</head> </head>
<body> <body>
<div id="6f9c3131db8f47a4a59cb1c378befd1a" class="chart-container" style="width:900px; height:500px;"></div> <div id="96e181158616470fa998603d0d2b37ae" class="chart-container" style="width:900px; height:500px;"></div>
<script> <script>
var chart_6f9c3131db8f47a4a59cb1c378befd1a = echarts.init( var chart_96e181158616470fa998603d0d2b37ae = echarts.init(
document.getElementById('6f9c3131db8f47a4a59cb1c378befd1a'), 'white', {renderer: 'canvas'}); document.getElementById('96e181158616470fa998603d0d2b37ae'), 'white', {renderer: 'canvas'});
var option_6f9c3131db8f47a4a59cb1c378befd1a = { var option_96e181158616470fa998603d0d2b37ae = {
"animation": true, "animation": true,
"animationThreshold": 2000, "animationThreshold": 2000,
"animationDuration": 1000, "animationDuration": 1000,
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
"animationEasingUpdate": "cubicOut", "animationEasingUpdate": "cubicOut",
"animationDelayUpdate": 0, "animationDelayUpdate": 0,
"color": [ "color": [
"yellow",
"blue",
"red",
"#c23531", "#c23531",
"#2f4554", "#2f4554",
"#61a0a8", "#61a0a8",
...@@ -49,7 +52,7 @@ ...@@ -49,7 +52,7 @@
"series": [ "series": [
{ {
"type": "line", "type": "line",
"name": "\u6210\u7ee9", "name": "\u806a\u806a",
"connectNulls": false, "connectNulls": false,
"symbolSize": 4, "symbolSize": 4,
"showSymbol": true, "showSymbol": true,
...@@ -119,7 +122,7 @@ ...@@ -119,7 +122,7 @@
}, },
{ {
"type": "line", "type": "line",
"name": "\u6210\u7ee9", "name": "\u5c0f\u6770",
"connectNulls": false, "connectNulls": false,
"symbolSize": 4, "symbolSize": 4,
"showSymbol": true, "showSymbol": true,
...@@ -189,7 +192,7 @@ ...@@ -189,7 +192,7 @@
}, },
{ {
"type": "line", "type": "line",
"name": "\u6210\u7ee9", "name": "\u76ae\u76ae",
"connectNulls": false, "connectNulls": false,
"symbolSize": 4, "symbolSize": 4,
"showSymbol": true, "showSymbol": true,
...@@ -261,12 +264,14 @@ ...@@ -261,12 +264,14 @@
"legend": [ "legend": [
{ {
"data": [ "data": [
"\u6210\u7ee9", "\u806a\u806a",
"\u6210\u7ee9", "\u5c0f\u6770",
"\u6210\u7ee9" "\u76ae\u76ae"
], ],
"selected": { "selected": {
"\u6210\u7ee9": true "\u806a\u806a": true,
"\u5c0f\u6770": true,
"\u76ae\u76ae": true
}, },
"show": true, "show": true,
"padding": 5, "padding": 5,
...@@ -351,11 +356,10 @@ ...@@ -351,11 +356,10 @@
} }
], ],
"title": { "title": {
"text": "\u6210\u7ee9", "text": "\u6210\u7ee9\u8d70\u52bf\u56fe"
"subteat": "\u5206"
} }
}; };
chart_6f9c3131db8f47a4a59cb1c378befd1a.setOption(option_6f9c3131db8f47a4a59cb1c378befd1a); chart_96e181158616470fa998603d0d2b37ae.setOption(option_96e181158616470fa998603d0d2b37ae);
</script> </script>
</body> </body>
</html> </html>
from pyecharts.charts import Line # from pyecharts.charts import Line
test = ["第1次","第2次","第3次","第4次","第5次","第6次","第7次","第8次","第9次","第10次"] # test = ["第1次","第2次","第3次","第4次","第5次","第6次","第7次","第8次","第9次","第10次"]
student1 = [112, 110, 118, 124, 129, 132, 136, 139, 144, 143] # 聪聪 # student1 = [112, 110, 118, 124, 129, 132, 136, 139, 144, 143] # 聪聪
student2 = [128, 131, 132, 129, 130, 127, 129, 131, 132, 128] # 小杰 # student2 = [128, 131, 132, 129, 130, 127, 129, 131, 132, 128] # 小杰
student3 = [143, 145, 140, 133, 134, 126, 121, 120, 114, 105] # 皮皮 # student3 = [143, 145, 140, 133, 134, 126, 121, 120, 114, 105] # 皮皮
#创建对应的图表对象 # #创建对应的图表对象
line=Line() # line=Line()
#传入x轴和y轴的数据 # #传入x轴和y轴的数据
line.add_xaxis(test) # line.add_xaxis(test)
line.add_yaxis("成绩",student1) # line.add_yaxis("聪聪",student1,color="red")
line.add_yaxis("成绩",student2) # line.add_yaxis("小杰",student2,color="blue")
line.add_yaxis("成绩",student3) # line.add_yaxis("皮皮",student3,color="yellow")
line.set_global_opts(title_opts={"text":"成绩","subteat":"分"}) # line.set_global_opts(title_opts={"text":"成绩走势图"})
#保存到本地文件 # #保存到本地文件
line.render("XXX.html") # line.render("XXXxxx.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