动态切换,图例会改变

描述:当前是关于Echarts图表中的 示例。
 
            option = {
  
		title: {
			text: '实例',
			show: '',
		},
		tooltip: {},
		legend: {
			data: ['销量','均线']
		},
		toolbox:{
			show:true,
			orient:'vertical',
			feature:{
				magicType:{
					show:true,
					type:['line','bar']
				}
			}
		},
		xAxis: {
			data: ["衬衫", "裤子", "毛衣", "牛仔裤", "口罩"]
		},
		yAxis: {},
		series: [{
				name: '销量',
				type: 'bar',
				data: [5, 6, 7, 8, 9]
				}, 
				{
				name: '均线',
				type: 'line',
				markLine: {
					data: [{
						yAxis: 2.5,
						symbolSize: 1,
						lineStyle: {
							normal: {
								color: '#eddb93',
								width: 2
							}
						}
					}]
				}
			}

		]
	
};