Commit 46e8e586 by BellCodeEditor

auto save

parent 9dc680c7
Showing with 95 additions and 69 deletions
from pyecharts import charts
bar=charts.Bar()
subjects = ["浈浈", "聪聪", "小智", "波奇"]
scores1 = [92, 95, 82, 88] # 期中成绩
scores2 = [95, 79, 93, 90] # 期末成绩
bar.add_xaxis(subjects)
bar.add_yaxis("期中",scores1,bar_width=40)
bar.add_yaxis("期末",scores2,bar_width=40,color="warmred")
bar.render()
\ No newline at end of file
line=charts.Line()
subjects = ["1", "2", "3", "4","5","6","7","8","9","10","11","12"]
scores1 = [2.6,5.9, 9.0,26.4,28.7,76.7,175.6,182.2,48.7,18.8,6.0,2.3]
# 期中成绩
line.add_xaxis(subjects)
line.add_yaxis("期中",scores1)
line.render()
\ No newline at end of file
......@@ -7,11 +7,11 @@
</head>
<body>
<div id="caa21caa86774f4cb8d2b3c09cc6892a" class="chart-container" style="width:900px; height:500px;"></div>
<div id="6f100848bc3044448c5dcdb5d458186a" class="chart-container" style="width:900px; height:500px;"></div>
<script>
var chart_caa21caa86774f4cb8d2b3c09cc6892a = echarts.init(
document.getElementById('caa21caa86774f4cb8d2b3c09cc6892a'), 'white', {renderer: 'canvas'});
var option_caa21caa86774f4cb8d2b3c09cc6892a = {
var chart_6f100848bc3044448c5dcdb5d458186a = echarts.init(
document.getElementById('6f100848bc3044448c5dcdb5d458186a'), 'white', {renderer: 'canvas'});
var option_6f100848bc3044448c5dcdb5d458186a = {
"animation": true,
"animationThreshold": 2000,
"animationDuration": 1000,
......@@ -21,7 +21,6 @@
"animationEasingUpdate": "cubicOut",
"animationDelayUpdate": 0,
"color": [
"warmred",
"#c23531",
"#2f4554",
"#61a0a8",
......@@ -49,71 +48,91 @@
],
"series": [
{
"type": "bar",
"type": "line",
"name": "\u671f\u4e2d",
"legendHoverLink": true,
"data": [
92,
95,
82,
88
],
"showBackground": false,
"barWidth": 40,
"barMinHeight": 0,
"barCategoryGap": "20%",
"barGap": "30%",
"large": false,
"largeThreshold": 400,
"seriesLayoutBy": "column",
"datasetIndex": 0,
"connectNulls": false,
"symbolSize": 4,
"showSymbol": true,
"smooth": false,
"clip": true,
"zlevel": 0,
"z": 2,
"step": false,
"data": [
[
"1",
2.6
],
[
"2",
5.9
],
[
"3",
9.0
],
[
"4",
26.4
],
[
"5",
28.7
],
[
"6",
76.7
],
[
"7",
175.6
],
[
"8",
182.2
],
[
"9",
48.7
],
[
"10",
18.8
],
[
"11",
6.0
],
[
"12",
2.3
]
],
"hoverAnimation": true,
"label": {
"show": true,
"position": "top",
"margin": 8
}
},
{
"type": "bar",
"name": "\u671f\u672b",
"legendHoverLink": true,
"data": [
95,
79,
93,
90
],
"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": {
"lineStyle": {
"show": true,
"position": "top",
"margin": 8
}
"width": 1,
"opacity": 1,
"curveness": 0,
"type": "solid"
},
"areaStyle": {
"opacity": 0
},
"zlevel": 0,
"z": 0
}
],
"legend": [
{
"data": [
"\u671f\u4e2d",
"\u671f\u672b"
"\u671f\u4e2d"
],
"selected": {
"\u671f\u4e2d": true,
"\u671f\u672b": true
"\u671f\u4e2d": true
}
}
],
......@@ -156,10 +175,18 @@
}
},
"data": [
"\u6d48\u6d48",
"\u806a\u806a",
"\u5c0f\u667a",
"\u6ce2\u5947"
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12"
]
}
],
......@@ -187,7 +214,7 @@
}
]
};
chart_caa21caa86774f4cb8d2b3c09cc6892a.setOption(option_caa21caa86774f4cb8d2b3c09cc6892a);
chart_6f100848bc3044448c5dcdb5d458186a.setOption(option_6f100848bc3044448c5dcdb5d458186a);
</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