使用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' } } } } ] };
相关文章
相关标签/搜索