给X轴分组
配置项如下
option = {
"title": {
"text": "产量统计"
},
"toolbox": {
"show": false,
"orient": "vertical",
"x": "right",
"y": "center",
"feature": {
"magicType": {
"show": true,
"type": ["stack", "tiled"]
},
"restore": {
"show": true
},
"saveAsImage": {
"show": true
}
}
},
"tooltip": {
"show": true
},
"calculable": true,
"legend": {
"show": false,
"data": ["1#", "2#", "3#", "4#", "5#", "6#", "粉1", "粉2", "粉3", "沥青", "总量"]
},
"xAxis": {
"type": "category",
"data": ["下面层普通沥青SUP-25"],
"name": "仓号"
},
"yAxis": {
"type": "value",
"name": "重量(KG)"
},
"series": [{
"name": "1#",
"type": "bar",
"data": [0],
"itemStyle": {
"normal": {
"color": "#ba2e2b"
}
}
}, {
"name": "2#",
"type": "bar",
"data": [170060],
"itemStyle": {
"normal": {
"color": "#ba2e2b"
}
}
}, {
"name": "3#",
"type": "bar",
"data": [173266],
"itemStyle": {
"normal": {
"color": "#ba2e2b"
}
}
}, {
"name": "4#",
"type": "bar",
"data": [106872],
"itemStyle": {
"normal": {
"color": "#ba2e2b"
}
}
}, {
"name": "5#",
"type": "bar",
"data": [69985],
"itemStyle": {
"normal": {
"color": "#ba2e2b"
}
}
}, {
"name": "6#",
"type": "bar",
"data": [163878],
"itemStyle": {
"normal": {
"color": "#ba2e2b"
}
}
}, {
"name": "粉1",
"type": "bar",
"data": [0],
"itemStyle": {
"normal": {
"color": "#ba2e2b"
}
}
}, {
"name": "粉2",
"type": "bar",
"data": [20794.2],
"itemStyle": {
"normal": {
"color": "#ba2e2b"
}
}
}, {
"name": "粉3",
"type": "bar",
"data": [0],
"itemStyle": {
"normal": {
"color": "#ba2e2b"
}
}
}, {
"name": "沥青",
"type": "bar",
"data": [30617.1],
"itemStyle": {
"normal": {
"color": "#ba2e2b"
}
}
}, {
"name": "总量",
"type": "bar",
"data": [735472.3],
"itemStyle": {
"normal": {
"color": "#ba2e2b"
}
}
}],
"label": {
"normal": {
"show": true,
"position": "top",
"textStyle": {
"color": "black"
}
}
}
}