Commit f322bdea by BellCodeEditor

auto save

parent d920a98d
Showing with 32 additions and 21 deletions
from pyecharts.charts import Bar from pyecharts.charts import Bar
bar=Bar() bar=Bar()
bar.add_xaxis(["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]) bar.add_xaxis(["","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"])
bar.add_yaxis("月商品销售表",[5,20,36,10,75,90]) bar.add_yaxis("月商品销售表",[5,20,36,10,75,90])
bar.render() bar.render()
\ No newline at end of file
...@@ -2,3 +2,7 @@ from pyecharts.charts import Bar ...@@ -2,3 +2,7 @@ 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]
bar=Bar()
bar.add_xaxis(subjects)
bar.add_yaxis("各科分数",scores)
bar.render()
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
</head> </head>
<body> <body>
<div id="3e64208160b94e4c8b29fcf8f88025e1" class="chart-container" style="width:900px; height:500px;"></div> <div id="61a67168e78d41bcbe7fa673a77c4d41" class="chart-container" style="width:900px; height:500px;"></div>
<script> <script>
var chart_3e64208160b94e4c8b29fcf8f88025e1 = echarts.init( var chart_61a67168e78d41bcbe7fa673a77c4d41 = echarts.init(
document.getElementById('3e64208160b94e4c8b29fcf8f88025e1'), 'white', {renderer: 'canvas'}); document.getElementById('61a67168e78d41bcbe7fa673a77c4d41'), 'white', {renderer: 'canvas'});
var option_3e64208160b94e4c8b29fcf8f88025e1 = { var option_61a67168e78d41bcbe7fa673a77c4d41 = {
"animation": true, "animation": true,
"animationThreshold": 2000, "animationThreshold": 2000,
"animationDuration": 1000, "animationDuration": 1000,
...@@ -49,15 +49,18 @@ ...@@ -49,15 +49,18 @@
"series": [ "series": [
{ {
"type": "bar", "type": "bar",
"name": "\u6708\u5546\u54c1\u9500\u552e\u8868", "name": "\u5404\u79d1\u5206\u6570",
"legendHoverLink": true, "legendHoverLink": true,
"data": [ "data": [
5, 88,
20, 95,
36, 96,
10, 94,
75, 62,
90 66,
64,
93,
89
], ],
"showBackground": false, "showBackground": false,
"barMinHeight": 0, "barMinHeight": 0,
...@@ -80,10 +83,10 @@ ...@@ -80,10 +83,10 @@
"legend": [ "legend": [
{ {
"data": [ "data": [
"\u6708\u5546\u54c1\u9500\u552e\u8868" "\u5404\u79d1\u5206\u6570"
], ],
"selected": { "selected": {
"\u6708\u5546\u54c1\u9500\u552e\u8868": true "\u5404\u79d1\u5206\u6570": true
} }
} }
], ],
...@@ -126,12 +129,15 @@ ...@@ -126,12 +129,15 @@
} }
}, },
"data": [ "data": [
"\u886c\u886b", "\u8bed\u6587",
"\u7f8a\u6bdb\u886b", "\u6570\u5b66",
"\u96ea\u7eba\u886b", "\u82f1\u8bed",
"\u88e4\u5b50", "\u5730\u7406",
"\u9ad8\u8ddf\u978b", "\u5386\u53f2",
"\u889c\u5b50" "\u653f\u6cbb",
"\u751f\u7269",
"\u5316\u5b66",
"\u7269\u7406"
] ]
} }
], ],
...@@ -159,7 +165,7 @@ ...@@ -159,7 +165,7 @@
} }
] ]
}; };
chart_3e64208160b94e4c8b29fcf8f88025e1.setOption(option_3e64208160b94e4c8b29fcf8f88025e1); chart_61a67168e78d41bcbe7fa673a77c4d41.setOption(option_61a67168e78d41bcbe7fa673a77c4d41);
</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