You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.5 KiB

3 years ago
export default function multipleColumn(columnName = [], xMsg = [], data = []) {
const valData = []
const color = ['#ff4852', '#ff6e25', '#ffbf00', '#20cc62', '#00d6d6', '#0084ff']
for (let [index, i] of data.entries()) {
let ojb = {
name: i.name,
type: 'bar',
barGap: 0,
emphasis: {
focus: 'series'
},
data: i.data,
itemStyle: {
color: color[index]
},
}
valData.push(ojb)
}
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: columnName,
textStyle: { //图例文字的样式
color: 'black',
fontSize: 8
},
3 years ago
left: 20,
3 years ago
itemWidth: 12,
itemHeight: 12,
borderRadius: 1, //圆角半径
},
3 years ago
grid: {
left: 20,
containLabel: true,
},
3 years ago
xAxis: {
type: 'category',
axisTick: {
show: false
},
axisLabel: {
3 years ago
textStyle: {
fontSize: 8
3 years ago
}
},
data: xMsg
},
yAxis: [{
type: 'value',
axisLabel: {
3 years ago
textStyle: {
fontSize: 8
3 years ago
}
},
}],
series: valData
}
return option
}