ECharts在柱状图的柱子上方显示数量的方法

在setOption()方法中的series配置中加上itemStyle配置

如下:

series: [{
            name: '人数',
            type: 'bar',
            data: [],        //x轴对应列的值
            itemStyle: {        //上方显示数值
                normal: {
                    label: {
                        show: true, //开启显示
                        position: 'top', //在上方显示
                        textStyle: { //数值样式
                            color: 'black',
                            fontSize: 16
                        }
                    }
                }
            }
        }]
原文地址:https://www.cnblogs.com/ihaokun/p/9808578.html