var weiChart = echarts.init(document.getElementById('box'));
option = {
   title: {
       text: '折线图堆叠'
   },
   tooltip: {
       trigger: 'axis'
   },
   legend: {
       data:['邮件营销','联盟广告','视频广告','直接访问','搜索引擎']
   },
   grid: {
       left: '3%',
       right: '4%',
       bottom: '3%',
       containLabel: true
   },
   toolbox: {
       feature: {
           saveAsImage: {}
       }
   },
   xAxis: {
       type: 'category',
       boundaryGap: false,
       data: ['周一','周二','周三','周四','周五','周六','周日']
   },
   yAxis: {
       type: 'value'
   },
   series: [
       {
           name:'',
           type:'line',        
           data:[120, 132, 191, "-", "-", "-", "-"]
       },
       {
           name:'',
           type:'line',     
           smooth:false,   //关键点,为true是不支持虚线,实线就用true
           itemStyle:{
               normal:{
                   lineStyle:{
                       width:2,
                       type:'dotted'  //'dotted'虚线 'solid'实线
                   }
               }
           },            
           data:["-", "-", 191, 234, 190, "-", "-"]
       },
       {
           name:'',
           type:'line',
           data:["-", "-", "-", "-", 190, 330, "-"]
       },
       {
           name:'',
           type:'line',
           smooth:false,   //关键点,为true是不支持虚线,实线就用true
           itemStyle:{
               normal:{
                   lineStyle:{
                       width:2,
                       type:'dotted'  //'dotted'虚线 'solid'实线
                   }
               }
           },            
           data:["-", "-", "-", "-", "-", 330, 410]
       },        

   ]
};




        weiChart.setOption(option);


echarts折线图实线加虚线


相关文章: