Commit 6e796d2a by BellCodeEditor

save project

parent c23df256
Showing with 170 additions and 54 deletions
from pyecharts.charts import Bar
subjects = ["浈浈", "聪聪", "小智", "波奇"]
scores1 = [92, 95, 82, 88] # 期中成绩
scores2 = [95, 79, 93, 90] # 期末成绩
......
......@@ -7,11 +7,11 @@
</head>
<body>
<div id="d7bd9c7e0c514dcbbb0caaee4268ad12" class="chart-container" style="width:900px; height:500px;"></div>
<div id="7efadd3c7289463b9451f584fc64cab0" class="chart-container" style="width:900px; height:500px;"></div>
<script>
var chart_d7bd9c7e0c514dcbbb0caaee4268ad12 = echarts.init(
document.getElementById('d7bd9c7e0c514dcbbb0caaee4268ad12'), 'white', {renderer: 'canvas'});
var option_d7bd9c7e0c514dcbbb0caaee4268ad12 = {
var chart_7efadd3c7289463b9451f584fc64cab0 = echarts.init(
document.getElementById('7efadd3c7289463b9451f584fc64cab0'), 'white', {renderer: 'canvas'});
var option_7efadd3c7289463b9451f584fc64cab0 = {
"animation": true,
"animationThreshold": 2000,
"animationDuration": 1000,
......@@ -48,71 +48,171 @@
],
"series": [
{
"type": "bar",
"name": "\u671f\u4e2d\u6210\u7ee9",
"legendHoverLink": true,
"type": "line",
"name": "\u964d\u6c34\u91cf",
"connectNulls": false,
"symbolSize": 4,
"showSymbol": true,
"smooth": false,
"clip": true,
"step": false,
"data": [
92,
95,
82,
88
[
"1\u6708",
2.6
],
[
"2\u6708",
5.9
],
[
"3\u6708",
9.0
],
[
"4\u6708",
26.4
],
[
"5\u6708",
28.7
],
[
"6\u6708",
76.7
],
[
"7\u6708",
175.6
],
[
"8\u6708",
182.2
],
[
"9\u6708",
48.7
],
[
"10\u6708",
18.8
],
[
"11\u6708",
6.0
],
[
"12\u6708",
2.3
]
],
"showBackground": false,
"barWidth": 40,
"barMinHeight": 0,
"barCategoryGap": "20%",
"barGap": "30%",
"large": false,
"largeThreshold": 400,
"seriesLayoutBy": "column",
"datasetIndex": 0,
"clip": true,
"zlevel": 0,
"z": 2,
"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,
"z": 0
},
{
"type": "bar",
"name": "\u671f\u672b\u6210\u7ee9",
"legendHoverLink": true,
"type": "line",
"name": "\u84b8\u53d1\u91cf",
"connectNulls": false,
"symbolSize": 4,
"showSymbol": true,
"smooth": false,
"clip": true,
"step": false,
"data": [
95,
79,
93,
90
[
"1\u6708",
2.6
],
[
"2\u6708",
5.9
],
[
"3\u6708",
9.0
],
[
"4\u6708",
26.4
],
[
"5\u6708",
28.7
],
[
"6\u6708",
76.7
],
[
"7\u6708",
175.6
],
[
"8\u6708",
182.2
],
[
"9\u6708",
48.7
],
[
"10\u6708",
18.8
],
[
"11\u6708",
6.0
],
[
"12\u6708",
2.3
]
],
"showBackground": false,
"barWidth": 40,
"barMinHeight": 0,
"barCategoryGap": "20%",
"barGap": "30%",
"large": false,
"largeThreshold": 400,
"seriesLayoutBy": "column",
"datasetIndex": 0,
"clip": true,
"zlevel": 0,
"z": 2,
"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,
"z": 0
}
],
"legend": [
{
"data": [
"\u671f\u4e2d\u6210\u7ee9",
"\u671f\u672b\u6210\u7ee9"
"\u964d\u6c34\u91cf",
"\u84b8\u53d1\u91cf"
],
"selected": {
"\u671f\u4e2d\u6210\u7ee9": true,
"\u671f\u672b\u6210\u7ee9": true
"\u964d\u6c34\u91cf": true,
"\u84b8\u53d1\u91cf": true
}
}
],
......@@ -155,10 +255,18 @@
}
},
"data": [
"\u6d48\u6d48",
"\u806a\u806a",
"\u5c0f\u667a",
"\u6ce2\u5947"
"1\u6708",
"2\u6708",
"3\u6708",
"4\u6708",
"5\u6708",
"6\u6708",
"7\u6708",
"8\u6708",
"9\u6708",
"10\u6708",
"11\u6708",
"12\u6708"
]
}
],
......@@ -186,7 +294,7 @@
}
]
};
chart_d7bd9c7e0c514dcbbb0caaee4268ad12.setOption(option_d7bd9c7e0c514dcbbb0caaee4268ad12);
chart_7efadd3c7289463b9451f584fc64cab0.setOption(option_7efadd3c7289463b9451f584fc64cab0);
</script>
</body>
</html>
from pyecharts.charts import Line
x = ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月",]
y = [2.6,5.9,9.0,26.4,28.7,76.7,175.6,182.2,48.7,18.8,6.0,2.3]
line = Line()
line.add_xaxis(x)
line.add_yaxis("降水量",y)
line.add_yaxis("蒸发量",y)
line.render()
\ 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