1.由于echarts图形是由遮罩层组成的,所以想在图形上直接加东西会被遮挡,所以需要结合绝对定位和优先层级来控制: position: absolute; z-index: 999;
效果:
代码:
<div style="position: relative;">
// 搜索框
<div style="position: absolute; z-index: 999;">
<input v-model="word" type="text" style="outline: none;"></input>
<ul v-show="showSearch">
<li style="width:172px;height: 20px;line-height:20px; >
<input style="margin-left:5px;" type="checkbox" />
<a >{{item2.name}}</a>
</li>
</ul>
</div>
// acharts图形遮罩层
<div id="figure5" style="width: 1200px;height:600px;"></div>
</div>
如果要做上方效果图中效果,根据在搜索框中搜索并选择某几个图例来控制图例的显示和隐藏,可参考这篇文章: