有时候Y轴的内容会特别长,我们需要根据文字多少来自适应宽度
只需要在gird里面添加containLabel为true就可以了
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
另外我们不想让数值显示在柱状图上,只需要把series下的label给去除掉就可以了
最终效果是这样的柱状图
//10月各分局消息预警统计
var yjtj = echarts.init(document.getElementById('yjtjchart'));
yjtj.setOption({
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器ÿ