使用echarts插件作圖表常見的幾個問題(一)—— 折線圖局部虛線

場景:實現折線圖局部虛線spa

措施:series中兩組數據name相同,data數據部分,實現或者虛線無值的部分用空來佔位。code

代碼以下:orm

option = { xAxis: { type: 'category', data: ['1日', '2日', '3日', '4日', '5日', '6日', '7日','8日','9日','10日'] }, yAxis: { type: 'value' }, series: [{  name:'產量', data: [820, 932,'','',930,1200,1000,1110,'',''], type: 'line', itemStyle: { normal: { lineStyle: { width: 2 } } } }, {  name:'產量', data: ['',932,800, 900, 930, '','',1110,1200,900], type: 'line', itemStyle: { normal: { lineStyle: { width: 2,  type:'dashed' } } } } ] };
相關文章
相關標籤/搜索