echarts分组显示

option = {
    tooltip: {
        trigger: 'axis',
        axisPointer: {            // 坐标轴指示器,坐标轴触发有效
            type: 'shadow'        // 默认为直线,可选为:'line' | 'shadow'
        }
    },
    legend: {
        data: ['PR','PR达成率']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis: {
             data: ['19年平均', '18年平均', '17年平均', '',
            'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun','Jul','Aug','Sep','Oct','Nov','Dec','',
            'week1', 'week2', 'week3', 'week4', 'week5','',
            '1日', '2日', '3日', '4日', '5日', '6日','7日'],
            type: 'category',
            axisLabel: {
                interval: 0,
                show: true,
                 rotate:45,
                textStyle: {
                    color: '#FFFFFF',
                },
                fontSize: 10,
                formatter:function(param){
                    if(param==''){
                        return ''
                    }else{
                         return param
                    }
                   
                }
            },
            axisTick: {
                show: true,
                length:15,
                interval:function(index, value){
                      console.log(index,value)
                      var datats= ['19年平均', '18年平均', '17年平均', '',
            'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun','Jul','Aug','Sep','Oct','Nov','Dec','',
            'week1', 'week2', 'week3', 'week4', 'week5','',
            '1日', '2日', '3日', '4日', '5日', '6日','7日','']
                          if(index!=28){
                              if(value!=''&&datats[index-1]=='' ){
                                return true
                              }else{
                                  return false
                              }
                          }else{
                              return false
                          }
                }
                
            },
            axisLine: {
                show: true
            },
        },
    yAxis: [
        {
            type: 'value'
        }
    ],
    series: [
        {
            name: 'PR',
            type: 'bar',
            arWidth:'25%',
            itemStyle: {
                normal: {
                    color: '#148084',
                }
            },
            data: [320, 23, 301, '',
            334, 390, 330, 320, 332, 301, 334, 390, 330, 320, 332, 301,'',
            334, 390, 330, 320,120,'',
            150,150,150,150,150,120,120]
        },
          {
            name: 'PR',
            type: 'line',
            arWidth:'25%',
            itemStyle: {
                normal: {
                    color: '#148084',
                }
            },
            data: [320, 23, 301, '',
            334, 390, 330, 320, 332, 301, 334, 390, 330, 320, 332, 301,'',
            334, 390, 330, 320,120,'',
            150,150,150,150,150,120,120]
        },
        {
            name:'PR达成率',
            type: 'line',
            barWidth:'25%',
            itemStyle: {
                normal: {
                    color:'#00D200'
                }
            },

           data:[320, 23, 301, '',
            334, 390, 330, 320, 332, 301, 334, 390, 330, 320, 332, 301,'',
            334, 390, 330, 320,120,'',
            150,150,150,150,150,120,120]
        },
        {
            name:'PR达成率',
            type: 'bar',
            barWidth:'25%',
            itemStyle: {
                normal: {
                    color:'#00D200'
                }
            },

           data: [320, 23, 301, '',
            334, 390, 330, 320, 332, 301, 334, 390, 330, 320, 332, 301,'',
            334, 390, 330, 320,120,'',
            150,150,150,150,150,120,120]
        } 
    ]
};

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值