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.

70 lines
1.8 KiB

3 years ago
export default function multipleColumn(columnName = [], xMsg = [], data = [],) {
3 years ago
const valData = []
3 years ago
const color = ['#FF4852', '#FF6E25', '#FFBF00', '#20CC62', '#00D6D6', '#00AAFF', '#7257FF']
3 years ago
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',
3 years ago
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
fontSize: 9
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true
3 years ago
},
legend: {
data: columnName,
textStyle: { //图例文字的样式
color: 'black',
fontSize: 8
},
3 years ago
left: 20,
3 years ago
itemWidth: 10,
itemHeight: 10,
// borderRadius: 1, //圆角半径
3 years ago
},
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
}