Commit 46e8e586 by BellCodeEditor

auto save

parent 9dc680c7
Showing with 95 additions and 69 deletions
from pyecharts import charts from pyecharts import charts
bar=charts.Bar() line=charts.Line()
subjects = ["浈浈", "聪聪", "小智", "波奇"] subjects = ["1", "2", "3", "4","5","6","7","8","9","10","11","12"]
scores1 = [92, 95, 82, 88] # 期中成绩 scores1 = [2.6,5.9, 9.0,26.4,28.7,76.7,175.6,182.2,48.7,18.8,6.0,2.3]
scores2 = [95, 79, 93, 90] # 期末成绩 # 期中成绩
bar.add_xaxis(subjects) line.add_xaxis(subjects)
bar.add_yaxis("期中",scores1,bar_width=40) line.add_yaxis("期中",scores1)
bar.add_yaxis("期末",scores2,bar_width=40,color="warmred") line.render()
bar.render() \ No newline at end of file
\ No newline at end of file
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
</head> </head>
<body> <body>
<div id="caa21caa86774f4cb8d2b3c09cc6892a" class="chart-container" style="width:900px; height:500px;"></div> <div id="6f100848bc3044448c5dcdb5d458186a" class="chart-container" style="width:900px; height:500px;"></div>
<script> <script>
var chart_caa21caa86774f4cb8d2b3c09cc6892a = echarts.init( var chart_6f100848bc3044448c5dcdb5d458186a = echarts.init(
document.getElementById('caa21caa86774f4cb8d2b3c09cc6892a'), 'white', {renderer: 'canvas'}); document.getElementById('6f100848bc3044448c5dcdb5d458186a'), 'white', {renderer: 'canvas'});
var option_caa21caa86774f4cb8d2b3c09cc6892a = { var option_6f100848bc3044448c5dcdb5d458186a = {
"animation": true, "animation": true,
"animationThreshold": 2000, "animationThreshold": 2000,
"animationDuration": 1000, "animationDuration": 1000,
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
"animationEasingUpdate": "cubicOut", "animationEasingUpdate": "cubicOut",
"animationDelayUpdate": 0, "animationDelayUpdate": 0,
"color": [ "color": [
"warmred",
"#c23531", "#c23531",
"#2f4554", "#2f4554",
"#61a0a8", "#61a0a8",
...@@ -49,71 +48,91 @@ ...@@ -49,71 +48,91 @@
], ],
"series": [ "series": [
{ {
"type": "bar", "type": "line",
"name": "\u671f\u4e2d", "name": "\u671f\u4e2d",
"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": [
[
"1",
2.6
],
[
"2",
5.9
],
[
"3",
9.0
],
[
"4",
26.4
],
[
"5",
28.7
],
[
"6",
76.7
],
[
"7",
175.6
],
[
"8",
182.2
],
[
"9",
48.7
],
[
"10",
18.8
],
[
"11",
6.0
],
[
"12",
2.3
]
],
"hoverAnimation": true,
"label": { "label": {
"show": true, "show": true,
"position": "top", "position": "top",
"margin": 8 "margin": 8
}
}, },
{ "lineStyle": {
"type": "bar",
"name": "\u671f\u672b",
"legendHoverLink": true,
"data": [
95,
79,
93,
90
],
"showBackground": false,
"barWidth": 40,
"barMinHeight": 0,
"barCategoryGap": "20%",
"barGap": "30%",
"large": false,
"largeThreshold": 400,
"seriesLayoutBy": "column",
"datasetIndex": 0,
"clip": true,
"zlevel": 0,
"z": 2,
"label": {
"show": true, "show": true,
"position": "top", "width": 1,
"margin": 8 "opacity": 1,
} "curveness": 0,
"type": "solid"
},
"areaStyle": {
"opacity": 0
},
"zlevel": 0,
"z": 0
} }
], ],
"legend": [ "legend": [
{ {
"data": [ "data": [
"\u671f\u4e2d", "\u671f\u4e2d"
"\u671f\u672b"
], ],
"selected": { "selected": {
"\u671f\u4e2d": true, "\u671f\u4e2d": true
"\u671f\u672b": true
} }
} }
], ],
...@@ -156,10 +175,18 @@ ...@@ -156,10 +175,18 @@
} }
}, },
"data": [ "data": [
"\u6d48\u6d48", "1",
"\u806a\u806a", "2",
"\u5c0f\u667a", "3",
"\u6ce2\u5947" "4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12"
] ]
} }
], ],
...@@ -187,7 +214,7 @@ ...@@ -187,7 +214,7 @@
} }
] ]
}; };
chart_caa21caa86774f4cb8d2b3c09cc6892a.setOption(option_caa21caa86774f4cb8d2b3c09cc6892a); chart_6f100848bc3044448c5dcdb5d458186a.setOption(option_6f100848bc3044448c5dcdb5d458186a);
</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