Commit 70d10616 by BellCodeEditor

save project

parent bb9a99eb
Showing with 30 additions and 31 deletions
from pyecharts.charts import Bar
subjects = ["18-","18-25","26-35","35-45","50+"]
scores1 = [88,95,96,94,56]
scores2 = [62,66,64,93]
from pyecharts.charts import Bar
subjects = ["浈浈", "聪聪", "小智", "波奇"]
scores1 = [92, 95, 82, 88]
scores2 = [95, 79, 93, 90]
bar = Bar()
bar.add_xaxis(subjects)
bar.add_yaxis("男",scores1)
bar.add_yaxis("女",scores2)
bar.add_yaxis("期中",scores1,bar_width=50)
bar.add_yaxis("期末",scores2,bar_width=50)
bar.render()
\ No newline at end of file
......@@ -7,11 +7,11 @@
</head>
<body>
<div id="2f5b0170b98845c59f2b97e581090cf3" class="chart-container" style="width:900px; height:500px;"></div>
<div id="f099f4d7f0cd4769bc7c49db42e2504d" class="chart-container" style="width:900px; height:500px;"></div>
<script>
var chart_2f5b0170b98845c59f2b97e581090cf3 = echarts.init(
document.getElementById('2f5b0170b98845c59f2b97e581090cf3'), 'white', {renderer: 'canvas'});
var option_2f5b0170b98845c59f2b97e581090cf3 = {
var chart_f099f4d7f0cd4769bc7c49db42e2504d = echarts.init(
document.getElementById('f099f4d7f0cd4769bc7c49db42e2504d'), 'white', {renderer: 'canvas'});
var option_f099f4d7f0cd4769bc7c49db42e2504d = {
"animation": true,
"animationThreshold": 2000,
"animationDuration": 1000,
......@@ -49,16 +49,16 @@
"series": [
{
"type": "bar",
"name": "\u7537",
"name": "\u671f\u4e2d",
"legendHoverLink": true,
"data": [
88,
92,
95,
96,
94,
56
82,
88
],
"showBackground": false,
"barWidth": 50,
"barMinHeight": 0,
"barCategoryGap": "20%",
"barGap": "30%",
......@@ -77,15 +77,16 @@
},
{
"type": "bar",
"name": "\u5973",
"name": "\u671f\u672b",
"legendHoverLink": true,
"data": [
62,
66,
64,
93
95,
79,
93,
90
],
"showBackground": false,
"barWidth": 50,
"barMinHeight": 0,
"barCategoryGap": "20%",
"barGap": "30%",
......@@ -106,12 +107,12 @@
"legend": [
{
"data": [
"\u7537",
"\u5973"
"\u671f\u4e2d",
"\u671f\u672b"
],
"selected": {
"\u7537": true,
"\u5973": true
"\u671f\u4e2d": true,
"\u671f\u672b": true
}
}
],
......@@ -154,11 +155,10 @@
}
},
"data": [
"18-",
"18-25",
"26-35",
"35-45",
"50+"
"\u6d48\u6d48",
"\u806a\u806a",
"\u5c0f\u667a",
"\u6ce2\u5947"
]
}
],
......@@ -186,7 +186,7 @@
}
]
};
chart_2f5b0170b98845c59f2b97e581090cf3.setOption(option_2f5b0170b98845c59f2b97e581090cf3);
chart_f099f4d7f0cd4769bc7c49db42e2504d.setOption(option_f099f4d7f0cd4769bc7c49db42e2504d);
</script>
</body>
</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