option3 = {
title: {
text: '设备状态记录',
subtext: '',
x: 'center', y: 'top'
},
legend: { y: 'bottom' },
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
dataset: {
source: bardata
},
xAxis: { type: 'category' },
yAxis: {},
// Declare several bar series, each will be mapped
// to a column of dataset.source by default.
series: [
{ type: 'line', color: BarColorList[0] },
{ type: 'line', //设置类型,line/bar
color: BarColorList[1], //设置颜色
barGap: '0' //设置bar间距
}
]
};
数据示例:两个类型
var item = {
name: res.rows[i]["name"],
报修数: res.rows[i]["value1"],
维修数: res.rows[i]["value2"]
};
bardata.push(item);