//先定义图表容器, 至于图表所需要的js啥的, 请自行搜索教程, 不多赘述
<div id="timeCostDiv" style="height:300px; width:90%; margin-left:5%;" />
created() {
this.loadTimeCost()
},
loadTimeCost() {
const that = this
const param = { dateBegin: that.dateBegin, dateEnd: that.dateEnd, limit: 5, type: that.dateType }
timeCostStatistics(param).then(data => {
if (data) {
var dataList = []
// color: ['#fec12b', '#f3535f', '#2163db', '#a43971', '#00d0b0'],
// 第一个数值, 代表维度列数, 第二个数值是数据范围start, 第三个数值是数据范围end, 第四个数值是第几根柱子, 第五个数值代表当前维度列有几个柱子
// data.push({ name: '1', value: [0, 0, 120, 1, 4] })
dataList.push({ itemStyle: { normal: { color: '#fec12b' }}, name: '进场时间', value: [0, 0, data.timeCostStatistics[0].carApproachTimeCost, 1, 3] })
dataList.push({ itemStyle: { normal: { color: '#f3535f' }}, name: '检测时间', value: [0, 0, data.timeCostStatistics[0].carTimeCost, 2, 3] })
dataList.push({ itemStyle: { normal: { color: '#2163db' }}, name: '等候时间', value: [0, 0, data.timeCostStatistics[0].carWaitTimeCost, 3, 3] })
dataList.push({ itemStyle: { normal: { color: '