双柱渐变图背景图

 

option = {

    backgroundColor: '#1b2735',

    tooltip: {//提示框组件

        trigger: 'axis',//触发类型 柱状图

        axisPointer:{type:'shadow'} //触发效果 移动上去 背景效果

    },    

    xAxis: [//x轴

        {

            type: 'category',//坐标轴类型 离散

            data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月'],//数据

            axisTick:false,//是否显示刻度

            axisLine: {//坐标轴样式

                show: true,//是否显示

                lineStyle: {//线的样式

                    type:'dashed'//线的类型 虚线

                },

            },

             axisLabel: {

                color: "#DEDEDE"

                }

        },

    ],

    yAxis: [//y轴

        {

            min: 0,//最小

            max: 700,//最大

            interval: 100,//相差

            name: '单位:',//名称

            type: 'value',//连续类型

            axisLine: {//坐标轴样式

                show: false, //不显示

            },

            splitLine: {//分隔辅助线

                lineStyle: {

                     type:'dashed',//线的类型 虚线0

                     opacity:0.2//透明度

                },

            },

             axisLabel: {

                color: "#DEDEDE"

                }

        },

    ],

    series: [//系统列表   

        {

            name: '用水消耗',//名称

            type: 'bar',//类型

            barWidth :11,//宽度

            data: [300, 450, 90, 300, 520, 450, 150, 300],//数值

            z:2,

            itemStyle: {

                color: {//渐变色

                    x: 0,

                    y: 0,

                    x2: 0,

                    y2: 1,

                    type: 'linear',

                    global: false,

                     colorStops: [

                        {

                            offset: 0,

                            color: 'rgba(6, 244, 231)',

                        },

                        {

                            offset: 1,

                            color: 'rgba(6, 244, 231,0)',

                        },

                    ],

                },

            },

        },

        {

            name: '电力消耗',

            type: 'bar',

            barWidth : 11,

            data: [400, 600, 90, 400, 400, 250, 90, 400],

            z:1,

            itemStyle: {

                color: {

                    x: 0,

                    y: 0,

                    x2: 0,

                    y2: 1,

                    type: 'linear',

                    global: false,

                    colorStops: [

                    {

                        offset: 0,

                        color: 'rgba(3, 181, 243)',

                    },

                    {

                        offset: 1,

                        color: 'rgba(2, 190, 251,0)',

                    },

                    ],

                  

                },

            },

        },

         {

            name: "",   

            barGap: '-220%',

            type: 'bar',

            z:0,

            data: [420,620,110,420,540,470,170,420],

            barWidth: '48px',

            itemStyle: {

                normal: {

                    color: '#fff', // 0% 处的颜色

                     opacity:0.1//透明度

                }

            },

        },

    ],

    legend: {

        right: '70',

        textStyle: {

            // 图例文字的样式

            color: '#fff',

            fontSize: 14,

            padding: [2, 0, 0, 2], 

            fontWeight: 100,

        },

    },

};

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值