项目查询结果可能有上百条,使用echarts,然后查询完了legend就铺满了图表,看不清了,看了一下官网有分页设置:
legend: {
type: 'scroll',
bottom: 10,
data: data
},
这是横向翻页,效果如下,官方示例:
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/f9fc0dc88034e839860781c4f51d90d0.png)
legend: {
type: 'scroll',
orient: 'vertical',
right: 10,
top: 20,
bottom: 20,
data: data.legendData,
selected: data.selected // 这是默认选中与否的图例
},
这是纵向翻页,效果如下,官方示例:
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/0cdfb5d6a39b49a1d4e5718c0f31fe89.png)