let txtes = "
我也是加粗效果"
var option = {
title: {
text: '',
left: 'center',
subtext: "12312312312",
bottom: '-1%',
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
},
},
legend: {},
grid: {
left: '3%',
right: '4%',
bottom: '5%',
containLabel: true,
},
xAxis: [
{
type: 'category',
data: ["1", "2", "3", "4", "5"],
},
],
yAxis: [
{
type: 'value',
},
],
series: [{
name: ["", "123123123", "123123123", "123123123", "123123123"],
type: "bar",
tooltip: {
trigger: "item",
formatter: `人数:{c}
来源渠道:
{b}${txtes}`
},
barWidth: "60%",
data: [{
name: "asdkjh",
value: 56,
}, {
name: "asdkjh",
value: 26,
}, {
name: "asdkjh",
value: 219,
}, {
name: "asdkjh",
value: 34,
},]
}]
}
option && getchart.setOption(option)
//随着屏幕大小调节图表
window.addEventListener('resize', () => {
getchart.resize()
}) ```
效果图