echarts 多柱状图 不同背景色设置 柱图间隔为空(柱子的宽度)

option = {
    color: ['#00da9c', '#005193', '#deb434', '#5fb878', '#ffb980', '#d87a80', '#23c6c8'],
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'shadow',
        },
    },
    grid: {
        //控制整体布局
        left: '10%',
        right: '10%',
        bottom: '15%',
        top: '5%',
        containLabel: true,
    },
    legend: {
        data: ['前年', '去年', '今年', '平均'],
        align: 'right',
        right: 10,
        textStyle: {
            color: '#999999',
        },
        itemWidth: 10,
        itemHeight: 10,
        itemGap: 35,
    },
    xAxis: {
        type: 'category',
        data: ['10月', '11月', '12月', '1月'],
        splitLine: {
            show: false,
        },
        axisLine: {
            lineStyle: {
                color: '#DFE3E9', // x轴颜色
                width: 1, // 粗细
            },
        },
        axisLabel: {
            color: '#999999', // x轴刻度名称颜色
            interval: 0, //代表显示所有x轴标签显示
            rotate: 45, //代表逆时针旋转45度
        },
        splitArea: {
            show: true,
            interval: 0,
            areaStyle: {
                color: ['#f3f2f2', '#eceaea'],
            },
        },
    },
    yAxis: [
        {
            type: 'value',
            axisLabel: {
                color: '#999999', // y轴刻度名称颜色
            },
            splitLine: {
                show: true,
                lineStyle: {
                    type: 'dashed',
                },
            },
            axisTick: {
                //y轴刻度线
                show: false,
            },
            axisLine: {
                //y轴
                show: false,
            },
        },
    ],
    series: [
        {
            name: '前年',
            type: 'bar',
            barGap: 0,
           // barWidth : 30,//柱图宽度
            barMaxWidth:30,//最大宽度
            data: [230, 180, 80, 130],
        },
        {
            name: '去年',
            type: 'bar',
            barGap: 0,
            data: [220, 154, 90, 150],
        },
        {
            name: '今年',
            type: 'bar',
            barGap: 0,
            data: [220, 130, 90, 180],
        },
    ],
};

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值