diff --git a/src/views/homePage/Echarts/index.vue b/src/views/homePage/Echarts/index.vue index 838d08a5..ce85d49f 100644 --- a/src/views/homePage/Echarts/index.vue +++ b/src/views/homePage/Echarts/index.vue @@ -84,6 +84,34 @@ export default { legend: { icon: "circle", data: this.echartData.legendData, + selector: [ + { + // 全选 + type: "all", + // 可以是任意你喜欢的标题 + title: "全选", + }, + { + // 反选 + type: "inverse", + // 可以是任意你喜欢的标题 + title: "反选", + }, + ], + selectorLabel: { + show: true, + color: this.xFontColor, // 与 textStyle 的颜色一致 + backgroundColor: "rgba(3, 188, 255, 0.5)", // 或者您可以选择一个与整体背景一致的颜色 + padding: [4, 8], // 可以根据需要调整,这里示例为上下4px,左右8px + // 如果您想要边框,可以添加 borderColor 和 borderWidth + borderColor: this.xFontColor, + borderWidth: 0.5, + borderRadius: 2, + width: 30, + height: 16, + lineHeight: 16, + align: "center", + }, textStyle: { color: this.xFontColor, },