From 5a85b63c31e612b7feb9ae87af1d6fdb0235a3c5 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Mon, 25 Nov 2024 10:27:18 +0800 Subject: [PATCH] =?UTF-8?q?echarts=20=E6=B7=BB=E5=8A=A0=E5=85=A8=E9=80=89?= =?UTF-8?q?=E5=8F=8D=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/homePage/Echarts/index.vue | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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, },