想实现图例一根线显示,只需要在legend下加上属性 selectedMode: 'single' 这样就可以实现图表单选了
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>案例-未来一周气温变化</title>
</head>
<body>
<div id="main" style="width: 600px;height:400px;"></div>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/4.2.1/echarts.js"></script>
<s