echarts柱状图

欧阳小白 1年前 ⋅ 714 阅读
option = {
    tooltip : {
        trigger: 'axis',
        axisPointer : {            // 坐标轴指示器,坐标轴触发有效
            type : 'shadow'        // 默认为直线,可选为:'line' | 'shadow'
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis : [
        {
            
            type : 'category',
            data : ['交换机', '核心交换机', 'OLT设备', '传输设备', '汇聚交换'],
            axisTick: {
                alignWithLabel: true
            },
            axisLabel: {
                            show: true,
                            textStyle: {
                                color: 'black',
                                fontSize : 15,
                                fontWeight:20
                            }
                        }
        }
    ],
    yAxis : [
        {  name: '单位(kw))',
            type: 'value',  
            axisLabel: {  
                show: true,  
                interval: 'auto',  
                formatter: '{value}'  
                },  
            show: true  
        } 
    ],
    series : [
        {
            name:'直接访问',
            type:'bar',
            barWidth: '30%',
            data:[40, 30, 38, 56, 38],
            itemStyle: {
            normal: {
                color: '#597EF7',
                label: {
                    show: false,
                    //开启显示
                    position: 'top',
                    formatter: '{c}',
                    //在上方显示
                    textStyle: { //数值样式
                        color: '#000000',
                
                        fontSize: 12
                
                    }
                
                }
            }
        },

        }
    ]
};


全部评论: 0

    我有话说:

    咨询问题

    点击这里给我发消息

    淘宝咨询

    博主承接代做业务

    真·送云服务器

    咨询博主