|
|
@ -36,13 +36,14 @@ for (var i = 0; i < res.length; i++) { |
|
|
|
if (res[i].name != "") legendData.push(res[i].name); |
|
|
|
} |
|
|
|
let angle = 0; //角度,用来做简单的动画效果的
|
|
|
|
let decoDelta = 48; |
|
|
|
let decoDelta = 10; |
|
|
|
var options = { |
|
|
|
color: ["#68F4DD", "#FFDD69", "#3CC3F0", "#5C8CFE", "#51D5AD"], |
|
|
|
title: [ |
|
|
|
{ |
|
|
|
text: "999", |
|
|
|
top: "27%", |
|
|
|
// top: "27%",
|
|
|
|
top: "33%", |
|
|
|
textAlign: "center", |
|
|
|
left: "49%", |
|
|
|
textStyle: { |
|
|
@ -53,7 +54,8 @@ var options = { |
|
|
|
}, |
|
|
|
{ |
|
|
|
text: "总数", |
|
|
|
top: "38%", |
|
|
|
// top: "38%",
|
|
|
|
top: "48%", |
|
|
|
textAlign: "center", |
|
|
|
left: "49%", |
|
|
|
textStyle: { |
|
|
@ -77,6 +79,7 @@ var options = { |
|
|
|
}, |
|
|
|
}, |
|
|
|
legend: { |
|
|
|
show: false, |
|
|
|
orient: "vertical", |
|
|
|
// width: "350px",
|
|
|
|
height: "80px", |
|
|
@ -133,8 +136,10 @@ var options = { |
|
|
|
/** 饼图上刻度 */ |
|
|
|
{ |
|
|
|
type: "gauge", |
|
|
|
center: ["50%", "35%"], |
|
|
|
radius: "46%", // 错位调整此处
|
|
|
|
// center: ["50%", "35%"],
|
|
|
|
// radius: "46%", // 错位调整此处
|
|
|
|
center: ["50%", "45%"], |
|
|
|
radius: "60%", // 错位调整此处
|
|
|
|
startAngle: 0, |
|
|
|
endAngle: 360, |
|
|
|
splitNumber: 52, |
|
|
@ -157,7 +162,9 @@ var options = { |
|
|
|
renderItem: (params, api) => { |
|
|
|
let x0 = api.getWidth() / 2; |
|
|
|
let y0 = api.getHeight() / 2 - decoDelta; |
|
|
|
let r = (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.5; |
|
|
|
// let r = (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.5;
|
|
|
|
let r = (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.7; |
|
|
|
|
|
|
|
return { |
|
|
|
type: "circle", |
|
|
|
shape: { |
|
|
@ -184,7 +191,9 @@ var options = { |
|
|
|
shape: { |
|
|
|
cx: api.getWidth() / 2, |
|
|
|
cy: api.getHeight() / 2 - decoDelta, |
|
|
|
r: (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.5, |
|
|
|
// r: (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.5,
|
|
|
|
r: (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.7, |
|
|
|
|
|
|
|
startAngle: ((350 + -angle) * Math.PI) / 180, |
|
|
|
endAngle: ((120 + -angle) * Math.PI) / 180, |
|
|
|
}, |
|
|
@ -204,7 +213,8 @@ var options = { |
|
|
|
renderItem: (params, api) => { |
|
|
|
let x0 = api.getWidth() / 2; |
|
|
|
let y0 = api.getHeight() / 2 - decoDelta; |
|
|
|
let r = (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.5; |
|
|
|
// let r = (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.5;
|
|
|
|
let r = (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.7; |
|
|
|
return { |
|
|
|
type: "circle", |
|
|
|
shape: { |
|
|
@ -231,7 +241,8 @@ var options = { |
|
|
|
shape: { |
|
|
|
cx: api.getWidth() / 2, |
|
|
|
cy: api.getHeight() / 2 - decoDelta, |
|
|
|
r: (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.5, |
|
|
|
// r: (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.5,
|
|
|
|
r: (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.7, |
|
|
|
startAngle: ((150 + -angle) * Math.PI) / 180, |
|
|
|
endAngle: ((-30 + -angle) * Math.PI) / 180, |
|
|
|
}, |
|
|
@ -251,7 +262,8 @@ var options = { |
|
|
|
renderItem: (params, api) => { |
|
|
|
let x0 = api.getWidth() / 2; |
|
|
|
let y0 = api.getHeight() / 2 - decoDelta; |
|
|
|
let r = (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.56; |
|
|
|
// let r = (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.56;
|
|
|
|
let r = (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.8; |
|
|
|
return { |
|
|
|
type: "circle", |
|
|
|
shape: { |
|
|
@ -278,7 +290,8 @@ var options = { |
|
|
|
shape: { |
|
|
|
cx: api.getWidth() / 2, |
|
|
|
cy: api.getHeight() / 2 - decoDelta, |
|
|
|
r: (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.56, |
|
|
|
// r: (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.56,
|
|
|
|
r: (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.8, |
|
|
|
startAngle: ((590 + -angle) * Math.PI) / 180, |
|
|
|
endAngle: ((350 + -angle) * Math.PI) / 180, |
|
|
|
}, |
|
|
@ -298,7 +311,8 @@ var options = { |
|
|
|
renderItem: (params, api) => { |
|
|
|
let x0 = api.getWidth() / 2; |
|
|
|
let y0 = api.getHeight() / 2 - decoDelta; |
|
|
|
let r = (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.56; |
|
|
|
// let r = (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.56;
|
|
|
|
let r = (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.8; |
|
|
|
return { |
|
|
|
type: "circle", |
|
|
|
shape: { |
|
|
@ -325,7 +339,8 @@ var options = { |
|
|
|
shape: { |
|
|
|
cx: api.getWidth() / 2, |
|
|
|
cy: api.getHeight() / 2 - decoDelta, |
|
|
|
r: (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.56, |
|
|
|
// r: (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.56,
|
|
|
|
r: (Math.min(api.getWidth(), api.getHeight()) / 2) * 0.8, |
|
|
|
startAngle: ((90 + -angle) * Math.PI) / 180, |
|
|
|
endAngle: ((160 + -angle) * Math.PI) / 180, |
|
|
|
}, |
|
|
@ -341,9 +356,10 @@ var options = { |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: "pie", |
|
|
|
radius: ["45%", "40%"], |
|
|
|
center: ["50%", "35%"], |
|
|
|
|
|
|
|
// radius: ["45%", "40%"],
|
|
|
|
// center: ["50%", "35%"],
|
|
|
|
radius: ["60%", "52%"], |
|
|
|
center: ["50%", "45%"], |
|
|
|
z: 10, |
|
|
|
label: { |
|
|
|
show: false, |
|
|
@ -385,8 +401,10 @@ var options = { |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: "pie", |
|
|
|
radius: ["29%", "40%"], |
|
|
|
center: ["50%", "35%"], |
|
|
|
// radius: ["29%", "40%"],
|
|
|
|
// center: ["50%", "35%"],
|
|
|
|
radius: ["37%", "60%"], |
|
|
|
center: ["50%", "45%"], |
|
|
|
label: { |
|
|
|
show: false, |
|
|
|
}, |
|
|
|