This commit is contained in:
weipengfei 2023-12-18 17:56:31 +08:00
parent 190475cd25
commit c7c7fb0af8
1 changed files with 48 additions and 8 deletions

View File

@ -47,16 +47,33 @@ const initMap = () => {
let color = ['#00A8FF', '#4B5FDB', '#00FFCB', '#5BDBF6']; let color = ['#00A8FF', '#4B5FDB', '#00FFCB', '#5BDBF6'];
let data1 = [ let data1 = [
{ value: 400, name: '养殖种类: 本地鸡' }, { value: 400, name: '本地鸡' },
{ value: 435, name: '养殖种类: 本地鸭' }, { value: 435, name: '本地鸭' },
{ value: 580, name: '养殖种类: 本地鹅' }, { value: 580, name: '本地鹅' },
{ value: 884, name: '养殖种类: 本地猪' }, { value: 884, name: '本地猪' },
] ]
let option1 = { let option1 = {
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
}, },
color: color, 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: { legend: {
show: true, show: true,
// icon: "rect", // icon: "rect",
@ -69,6 +86,9 @@ const initMap = () => {
textStyle: { textStyle: {
color: "#fff" color: "#fff"
}, },
formatter: function (params) {
return '种类: ' + params;
}
}, },
series: [ series: [
{ {
@ -96,16 +116,33 @@ const initMap = () => {
}; };
let data2 = [ let data2 = [
{ value: 500, name: '养殖种类: 本地鸡' }, { value: 500, name: '本地鸡' },
{ value: 735, name: '养殖种类: 本地鸭' }, { value: 735, name: '本地鸭' },
{ value: 580, name: '养殖种类: 本地鹅' }, { value: 580, name: '本地鹅' },
{ value: 484, name: '养殖种类: 本地猪' }, { value: 484, name: '本地猪' },
] ]
let option2 = { let option2 = {
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
}, },
color: color, 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: { legend: {
show: true, show: true,
// icon: "rect", // icon: "rect",
@ -118,6 +155,9 @@ const initMap = () => {
textStyle: { textStyle: {
color: "#fff" color: "#fff"
}, },
formatter: function (params) {
return '种类: ' + params;
}
}, },
series: [ series: [
{ {