Commit 052a4f1a by BellCodeEditor

save project

parent 377b1a41
Showing with 51 additions and 10 deletions
......@@ -7,11 +7,11 @@
</head>
<body>
<div id="20d70b2eb07e4f4f92c7da5ddddb3ba9" class="chart-container" style="width:900px; height:500px;"></div>
<div id="6f7ff7e1d8984b4aaef8dc641a6dca77" class="chart-container" style="width:900px; height:500px;"></div>
<script>
var chart_20d70b2eb07e4f4f92c7da5ddddb3ba9 = echarts.init(
document.getElementById('20d70b2eb07e4f4f92c7da5ddddb3ba9'), 'white', {renderer: 'canvas'});
var option_20d70b2eb07e4f4f92c7da5ddddb3ba9 = {
var chart_6f7ff7e1d8984b4aaef8dc641a6dca77 = echarts.init(
document.getElementById('6f7ff7e1d8984b4aaef8dc641a6dca77'), 'white', {renderer: 'canvas'});
var option_6f7ff7e1d8984b4aaef8dc641a6dca77 = {
"animation": true,
"animationThreshold": 2000,
"animationDuration": 1000,
......@@ -49,7 +49,7 @@
"series": [
{
"type": "bar",
"name": "\u8d1e\u8d1e\u540c\u5b66\u7684\u6210\u7ee9",
"name": "\u671f\u4e2d\u8003\u8bd5\u6210\u7ee9",
"legendHoverLink": true,
"data": [
88,
......@@ -63,6 +63,40 @@
89
],
"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\u672b\u8003\u8bd5\u6210\u7ee9",
"legendHoverLink": true,
"data": [
90,
92,
98,
91,
78,
69,
71,
96,
83
],
"showBackground": false,
"barWidth": 40,
"barMinHeight": 0,
"barCategoryGap": "20%",
"barGap": "30%",
......@@ -83,10 +117,12 @@
"legend": [
{
"data": [
"\u8d1e\u8d1e\u540c\u5b66\u7684\u6210\u7ee9"
"\u671f\u4e2d\u8003\u8bd5\u6210\u7ee9",
"\u671f\u672b\u8003\u8bd5\u6210\u7ee9"
],
"selected": {
"\u8d1e\u8d1e\u540c\u5b66\u7684\u6210\u7ee9": true
"\u671f\u4e2d\u8003\u8bd5\u6210\u7ee9": true,
"\u671f\u672b\u8003\u8bd5\u6210\u7ee9": true
}
}
],
......@@ -165,7 +201,7 @@
}
]
};
chart_20d70b2eb07e4f4f92c7da5ddddb3ba9.setOption(option_20d70b2eb07e4f4f92c7da5ddddb3ba9);
chart_6f7ff7e1d8984b4aaef8dc641a6dca77.setOption(option_6f7ff7e1d8984b4aaef8dc641a6dca77);
</script>
</body>
</html>
from pyecharts.charts import Bar
bar = Bar()
subjects = ["语文","数学","英语","地理","历史","政治","生物","化学","物理"]
scores = [88, 95, 96, 94, 62, 66, 64, 93, 89]
scores1 = [88, 95, 96, 94, 62, 66, 64, 93, 89]
scores2 = [90, 92, 98, 91, 78, 69, 71, 96, 83]
bar.add_xaxis(subjects)
bar.add_yaxis("贞贞同学的成绩",scores)
bar.add_yaxis("期中考试成绩",scores1,bar_width=40)
bar.add_yaxis("期末考试成绩",scores2,bar_width=40)
bar.render("123.html")
\ 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