From c7c7fb0af87b9a6b6b9c7d6b5db9db33be9b5528 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Mon, 18 Dec 2023 17:56:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view/index/components/left.vue | 56 +++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/src/view/index/components/left.vue b/src/view/index/components/left.vue index 3ccd1dd..4e2f5fd 100644 --- a/src/view/index/components/left.vue +++ b/src/view/index/components/left.vue @@ -47,16 +47,33 @@ const initMap = () => { let color = ['#00A8FF', '#4B5FDB', '#00FFCB', '#5BDBF6']; let data1 = [ - { value: 400, name: '养殖种类: 本地鸡' }, - { value: 435, name: '养殖种类: 本地鸭' }, - { value: 580, name: '养殖种类: 本地鹅' }, - { value: 884, name: '养殖种类: 本地猪' }, + { value: 400, name: '本地鸡' }, + { value: 435, name: '本地鸭' }, + { value: 580, name: '本地鹅' }, + { value: 884, name: '本地猪' }, ] let option1 = { tooltip: { trigger: 'item', }, color: color, + tooltip: { + trigger: "item", + backgroundColor: 'rgba(0, 156, 255, 0.6)', //设置背景颜色 + textStyle: { + color: '#fff' + }, + borderColor: "rgba(0, 156, 255, 1)", + axisPointer: { + type: 'shadow', + shadowStyle: { + color: 'rgba(255,255,255, .2)', + } + }, + formatter: function (params) { + return params.data.name + ': ' + params.data.value; + } + }, legend: { show: true, // icon: "rect", @@ -69,6 +86,9 @@ const initMap = () => { textStyle: { color: "#fff" }, + formatter: function (params) { + return '种类: ' + params; + } }, series: [ { @@ -96,16 +116,33 @@ const initMap = () => { }; let data2 = [ - { value: 500, name: '养殖种类: 本地鸡' }, - { value: 735, name: '养殖种类: 本地鸭' }, - { value: 580, name: '养殖种类: 本地鹅' }, - { value: 484, name: '养殖种类: 本地猪' }, + { value: 500, name: '本地鸡' }, + { value: 735, name: '本地鸭' }, + { value: 580, name: '本地鹅' }, + { value: 484, name: '本地猪' }, ] let option2 = { tooltip: { trigger: 'item', }, color: color, + tooltip: { + trigger: "item", + backgroundColor: 'rgba(0, 156, 255, 0.6)', //设置背景颜色 + textStyle: { + color: '#fff' + }, + borderColor: "rgba(0, 156, 255, 1)", + axisPointer: { + type: 'shadow', + shadowStyle: { + color: 'rgba(255,255,255, .2)', + } + }, + formatter: function (params) { + return params.data.name + ': ' + params.data.value; + } + }, legend: { show: true, // icon: "rect", @@ -118,6 +155,9 @@ const initMap = () => { textStyle: { color: "#fff" }, + formatter: function (params) { + return '种类: ' + params; + } }, series: [ {