Echarts-同x轴2条折线-1条截取

81 阅读1分钟

e8fe5cedc7733a55041d387b73ca596.png

  1. 使用同一x轴, 默认情况,无需理会
  2. 截取的线,缺少的值 填null, Echarts 遇到null 不会绘制其值
...
series: [{
			name: '基线1',
			type: 'line',
			symbol: 'none',
			smooth: true,
			lineStyle: {
				color: '#00BF8F'
			},
			data: [300, 280, 250, 260, 270, 300, 550, 500],

		},
		{
			name: '基线2',
			type: 'line',
			symbol: 'none',
			smooth: true,
			lineStyle: {
                            color: '#3370FF'
			},
			areaStyle: 渐变色,
			data: [null, null, null, 260, 270, 300, null, null
			]
		}
	]
...