Commit a847c8b1 by BellCodeEditor

save project

parent 661fbbee
Showing with 51 additions and 29 deletions
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
</head> </head>
<body> <body>
<div id="61adfb9820e644cc92c643e57bd3ebeb" class="chart-container" style="width:900px; height:500px;"></div> <div id="d32946d3b82042e69d6834568c8989d8" class="chart-container" style="width:900px; height:500px;"></div>
<script> <script>
var chart_61adfb9820e644cc92c643e57bd3ebeb = echarts.init( var chart_d32946d3b82042e69d6834568c8989d8 = echarts.init(
document.getElementById('61adfb9820e644cc92c643e57bd3ebeb'), 'white', {renderer: 'canvas'}); document.getElementById('d32946d3b82042e69d6834568c8989d8'), 'white', {renderer: 'canvas'});
var option_61adfb9820e644cc92c643e57bd3ebeb = { var option_d32946d3b82042e69d6834568c8989d8 = {
"animation": true, "animation": true,
"animationThreshold": 2000, "animationThreshold": 2000,
"animationDuration": 1000, "animationDuration": 1000,
...@@ -49,20 +49,44 @@ ...@@ -49,20 +49,44 @@
"series": [ "series": [
{ {
"type": "bar", "type": "bar",
"name": "\u6d48\u6d48\u7684\u6210\u7ee9", "name": "\u671f\u4e2d",
"legendHoverLink": true, "legendHoverLink": true,
"data": [ "data": [
88, 2,
95, 5,
96, 2,
94, 8
62,
66,
64,
93,
89
], ],
"showBackground": false, "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,
"position": "top",
"margin": 8
}
},
{
"type": "bar",
"name": "\u671f\u4e2d",
"legendHoverLink": true,
"data": [
5,
9,
3,
9
],
"showBackground": false,
"barWidth": 40,
"barMinHeight": 0, "barMinHeight": 0,
"barCategoryGap": "20%", "barCategoryGap": "20%",
"barGap": "30%", "barGap": "30%",
...@@ -83,10 +107,11 @@ ...@@ -83,10 +107,11 @@
"legend": [ "legend": [
{ {
"data": [ "data": [
"\u6d48\u6d48\u7684\u6210\u7ee9" "\u671f\u4e2d",
"\u671f\u4e2d"
], ],
"selected": { "selected": {
"\u6d48\u6d48\u7684\u6210\u7ee9": true "\u671f\u4e2d": true
} }
} }
], ],
...@@ -129,15 +154,10 @@ ...@@ -129,15 +154,10 @@
} }
}, },
"data": [ "data": [
"\u8bed\u6587", "\u6d48\u6d48",
"\u6570\u5b66", "\u806a\u806a",
"\u82f1\u8bed", "\u5c0f\u667a",
"\u5730\u7406", "\u6ce2\u5947"
"\u5386\u53f2",
"\u653f\u6cbb",
"\u751f\u7269",
"\u5316\u5b66",
"\u7269\u7406"
] ]
} }
], ],
...@@ -165,7 +185,7 @@ ...@@ -165,7 +185,7 @@
} }
] ]
}; };
chart_61adfb9820e644cc92c643e57bd3ebeb.setOption(option_61adfb9820e644cc92c643e57bd3ebeb); chart_d32946d3b82042e69d6834568c8989d8.setOption(option_d32946d3b82042e69d6834568c8989d8);
</script> </script>
</body> </body>
</html> </html>
from pyecharts.charts import Bar from pyecharts.charts import Bar
subjects = ["语文","数学","英语","地理","历史","政治","生物","化学","物理"] subjects = ["浈浈", "聪聪", "小智", "波奇"]
scores = [88, 95, 96, 94, 62, 66, 64, 93, 89] scores1 = [2, 5, 2, 8]
scores2 = [5, 9, 3, 9]
bar = Bar() bar = Bar()
bar.add_xaxis(subjects) bar.add_xaxis(subjects)
bar.add_yaxis("浈浈的成绩", scores) bar.add_yaxis("期中", scores1, bar_width=40)
bar.add_yaxis("期中", scores2, bar_width=40)
bar.render("analysis.html") bar.render("analysis.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