let txtes = "<br><b>我也是加粗效果</b>"
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: `人數(shù):{c}<br><br><b>來源渠道:</b><br><br>条篷${txtes}`
},
barWidth: "60%",
data: [{
name: "asdkjh",
value: 56,
}, {
name: "asdkjh",
value: 26,
}, {
name: "asdkjh",
value: 219,
}, {
name: "asdkjh",
value: 34,
},]
}]
}
option && getchart.setOption(option)
//隨著屏幕大小調(diào)節(jié)圖表
window.addEventListener('resize', () => {
getchart.resize()
}) ```
效果圖