Commit 4cdfd0e8 by BellCodeEditor

save project

parent 30268e00
Showing with 47 additions and 9 deletions
...@@ -2,7 +2,9 @@ from pyecharts.charts import Bar ...@@ -2,7 +2,9 @@ from pyecharts.charts import Bar
subjects = ["语文","数学","英语","地理","历史","政治","生物","化学","物理"] subjects = ["语文","数学","英语","地理","历史","政治","生物","化学","物理"]
scores = [88, 95, 96, 94, 62, 66, 64, 93, 89] scores = [88, 95, 96, 94, 62, 66, 64, 93, 89]
scores2=[100,100,100,100,100,100,100,100,100]
bar=Bar() bar=Bar()
bar.add_xaxis(subjects) bar.add_xaxis(subjects)
bar.add_yaxis("成绩",scores) bar.add_yaxis("成绩",scores,bar_width=20)
bar.add_yaxis("2成绩",scores2,bar_width=20)
bar.render("成绩") bar.render("成绩")
<!DOCTYPE html> <!DOCTYPE html>
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
</head> </head>
<body> <body>
<div id="8f78be7455844b18b8a8243aa14dcccb" class="chart-container" style="width:900px; height:500px;"></div> <div id="05558231eb4846508ab2a83bcaccde8f" class="chart-container" style="width:900px; height:500px;"></div>
<script> <script>
var chart_8f78be7455844b18b8a8243aa14dcccb = echarts.init( var chart_05558231eb4846508ab2a83bcaccde8f = echarts.init(
document.getElementById('8f78be7455844b18b8a8243aa14dcccb'), 'white', {renderer: 'canvas'}); document.getElementById('05558231eb4846508ab2a83bcaccde8f'), 'white', {renderer: 'canvas'});
var option_8f78be7455844b18b8a8243aa14dcccb = { var option_05558231eb4846508ab2a83bcaccde8f = {
"animation": true, "animation": true,
"animationThreshold": 2000, "animationThreshold": 2000,
"animationDuration": 1000, "animationDuration": 1000,
...@@ -63,6 +63,40 @@ ...@@ -63,6 +63,40 @@
89 89
], ],
"showBackground": false, "showBackground": false,
"barWidth": 20,
"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": "2\u6210\u7ee9",
"legendHoverLink": true,
"data": [
100,
100,
100,
100,
100,
100,
100,
100,
100
],
"showBackground": false,
"barWidth": 20,
"barMinHeight": 0, "barMinHeight": 0,
"barCategoryGap": "20%", "barCategoryGap": "20%",
"barGap": "30%", "barGap": "30%",
...@@ -83,10 +117,12 @@ ...@@ -83,10 +117,12 @@
"legend": [ "legend": [
{ {
"data": [ "data": [
"\u6210\u7ee9" "\u6210\u7ee9",
"2\u6210\u7ee9"
], ],
"selected": { "selected": {
"\u6210\u7ee9": true "\u6210\u7ee9": true,
"2\u6210\u7ee9": true
} }
} }
], ],
...@@ -165,7 +201,7 @@ ...@@ -165,7 +201,7 @@
} }
] ]
}; };
chart_8f78be7455844b18b8a8243aa14dcccb.setOption(option_8f78be7455844b18b8a8243aa14dcccb); chart_05558231eb4846508ab2a83bcaccde8f.setOption(option_05558231eb4846508ab2a83bcaccde8f);
</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