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: [ {