渐变柱状+折线图echarts value配置项内容和展示

配置项如下
      let xData=[2016,2017,2018,2019,2020];
let yData=[1000,450,1200,1400,1500];
let yData1=[1200,500,1250,1500,1550];
let lineData=[20,40,60,80,95];
let lineData2=[30,50,70,90,100];
   console.log(xData,yData,lineData)
      let color = {
     x:0,
    y:0,
    x2:0,
    y2:1,
    colorStops:[
        {
            color:'#867DFF ',
            offset:0
        },
        {
            color:'#A59EFF',
            offset:1
        }
    ]
}
  let color2 = {
     x:0,
    y:0,
    x2:0,
    y2:1,
    colorStops:[
        {
            color:'#FFA531 ',
            offset:0
        },
        {
            color:'#FFC949',
            offset:1
        }
    ]
}
 option = {
    backgroundColor:"black",
    // tooltip:{
    //   backgroundColor:'transparent',
    //   borderWidth:0,
    //     trigger:'axis',
    //     formatter: item=>{
    //       console.log(item);
    //       return `<div style='width:289px;height:107px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASEAAABrCAMAAAAPd8SXAAADAFBMVEUAAAADTv9MqP1Np/8FZ/9Op/sCWP8MX/8IYP8IZP8MYf8NX/8CZP8KYv8KZP8KZf8IZf8AWf8IZ/9Lpvt67f8Obf8NbP9Mp/wzjPwegv84k/1Mp/0LcP8ojv9Lof9LpfoScv8kfv926v8fgf80kf0jff9WxP82kv4vi/0qjf83kP09mf1Ir/9Jpft71P9IpfxHof9Env9Jpfw4k/tLpfxDmP89l/1u4P82lv0ulP0qiv8dfP8ogv9EoPw/m/47lf0pgv9m1/9hyf0wkf01k/0/m/4mgf9NqPt05v9t3f9Iov0slv4vl/5Lp/xCnPxPrP06mP5Mpf1FoP1MqP1r1v9Np/xNp/tNqPxp2v9l0P9fyf9ayf9n0P8umP5z5P9v3v5Nqv1KpPx77f9hzP9Hovx67v9av/5Vtv5OqPwtmP4BC0ABDUQBEUcBG1EBMWgBFksBKV8BIlgBRn4BUYoBO3MBElABXpgBD0kBDkcBEU4BEEsCGFgCIGECFFMBEEwDOoEBFlUCMHYCKGwCGlwCL3IBFlMBF08B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gbp8w4G/fgQNkxN8fbMTfn4cOwYS/k3TAX+smsA5soWDq4ddouSVw3549e9o+/VThexnMzy1msro95ZAPTcR34CP2+2x04mccfogPZI8g9zY2njhxAv5Qx48f/1SsDWyHlX2JcEtwa4h14JtvNqFWGPC382RDC2g4CTP+APxGQwvuKhgnCUMlv0IwZXIHqiN0qNgkRy7S7GdqnIbm79HnPzHc8j0hAKZ73gruQ5dZdw1zv+AOAkeNUo+QSaO3M4+Be6l7BO5qXhrj7j4i0h+mDUrhqC+9l9OZ46rI7AHBwcF+MCV2ELqkG2Da7J2CG++8kZLPqmUeoG4SPM54WBUd7REeNdjL11lWCEd9BTicYZ4SSnf7Apj07ONz5d3oKgXXwo27i7makc86hht3i9hQgZOXhLe3txcXfFswHBjg4wCTc23C2eQUDDjeAc8twNH8bBx/f8qFuphyAwMFVxIWxmUPBDAp2wUH2LOJ2OwsA5UjVp555iybgpNpeSOMhJUAjpBHslCsFKbioAgzFIb1D8XJ9VCH5JH0UQ/k8LzDWTaFnmVAz1KB83dMB2DgaH0hlWRLYSseiwUTspmG9dOp6sJAddbnAtqHBbKTLUQbsX0EkXAnIekZKiyUJJZEfzZxfqRLv/4jI26TepAboMLWthBtxDcSRhJX4qFYK4bHIvoxgaOHjA680HQKhuiYEGC3xzydLW4E2LFFLBMPxVk6eoYcGgJ1aJ5eEkh0gpGsElI68go2iNrRReZnO/FA9nronCQSz8QPwWK6efqV4tFXdrqDzPcSUD5LjeWy7FwO80j62PMG4o1kkeShsJUCWoaTnsTXS/aPiLWDHbEVukAZLSOO04u2j9XzLzEU5wy5rBIdCdprT0/locSpeCx1vfhoWZVQJJYa7PKv0/wDOJOoJaoEef4AAAAASUVORK5CYII=") no-repeat center center'>
    //                 <div style='color:#CAEEFF;font-size:14px;padding-left:25px;padding-top:30px'>${item[0].name}年</div> 
    //                 <div style='color:#31C2FF;font-size:16px;padding-left:25px;'>${item[2].seriesName}:${item[2].value}</div>
    //               </div>`
    //     }
    // },
    legend:{  
        right:30,
        top:0,
        icon:'circle',
        textStyle:{
            color:"#CAEEFF",
            fontSize:14
        },
        itemWidth:12,
        itemHeight:12,
        data:[
            {
                name:'公共必修课'
            },
            {
              name:'公共选修课'  
            },
            {
            name:'专业课',
            itemStyle:{
                borderWidth:0
            }
            }
            ]
    },
    grid:{
        left:'3%',
        right:'3%',
        top:'20%',
        bottom:'5%',
        containLabel:true
    },
    xAxis: {
        data: xData,
        axisLine:{
            show:true,
               lineStyle:{
                color:'#31C2FF'
            }
        },
        axisTick:{
            show:false,
        },
        axisLabel:{
            show:true,
            color:"#CAEEFF",
            fontSize:14,
            formatter:function(params){
              return params + '年'
            }
        }
    },
    yAxis: [
        {
            type:'value',
            axisLine:{
                show:true,
                lineStyle:{
                color:'#31C2FF'
            }   
          } ,
           axisLabel:{
            show:true,
            color:"#CAEEFF",
            fontSize:14
        },  
      //   nameTextStyle: {
      //   color: '#CAEEFF',
      //   padding:[0,0,0,-30]
      // },
              axisTick:{
               show:false,
           },
             splitLine:{
               lineStyle: {
               color: '#31C2FF',
               opacity:0.2
        }
            },
        },
        {
            type:'value',
            max:100,
            min:0,
            splitLine:{
                show:false,
              
            },
              axisTick:{
            show:false,
   },
            axisLine:{
                show:true,
                lineStyle:{
                color:'#31C2FF'
            }
            },
             axisLabel:{
            show:true,
            color:"#CAEEFF",
        }
        }
    ],
    series: [
      {
        name:'公共必修课',
        type: 'bar',
        barWidth:42,
        data:yData,
        barGap:'5%',
        itemStyle:{
                color:color,
                borderRadius:[4,4,0,0],
        },
          label: {
            show: true,
            position: 'top', // 位置
            color: '#FFFFFF',
            fontSize: 14,
            distance: 1, // 距离
			      formatter: '{c} ' // 这里是数据展示的时候显示的数据
        } // 柱子上方的数值
    },
      {
        name:'公共选修课',
        type: 'bar',
        barWidth:42,
        data:yData1,
          itemStyle:{
                color:color2,
                 borderRadius:[4,4,0,0],
            },
          label: {
            show: true,
            position: 'top', // 位置
            color: '#FFFFFF',
            fontSize: 14,
            distance: 1, // 距离
			      formatter: '{c} ' // 这里是数据展示的时候显示的数据
        }, // 柱子上方的数值
    },
    {
        name: '专业课',
        type: 'line',
        data:lineData,
        yAxisIndex:1,
        symbolSize:10,
        symbol:'circle',
        label:{
            show:true,
            color: '#FFFFFF',
            fontSize: 14,
        },
        itemStyle:{
           normal:{
                color:"#008AFF",
                borderColor:'#FFFFFF',
                borderWidth:2
           }
        },
        lineStyle:{
            shadowColor:'#05ECF7',
            shadowBlur:5
        },
        tooltip:{
          formatter:function(params){
            console.log(params)
          }
        }
    },
    //   {
    //     name: '60人至90人课程门次',
    //     type: 'line',
    //     data:lineData2,
    //     yAxisIndex:1,
    //     symbolSize:10,
    //     symbol:'circle',
    //     label:{
    //       show:true  ,
    //       color: '#FFFFFF',
    //         fontSize: 14,
    //     },
    //     itemStyle:{
    //         color:"#FFC949",
    //     },
    //     lineStyle:{
    //         shadowColor:'#05ECF7',
    //         shadowBlur:5
    //     },
    //     tooltip:{
    //       formatter:function(params){
    //         console.log(params)
    //       }
    //     }
    // },
    ]
}
    
截图如下