|
|
@ -4,7 +4,7 @@ import * as echarts from 'echarts'; |
|
|
|
|
|
|
|
const PieChart = (props) => { |
|
|
|
|
|
|
|
const { width, height, data, colorList, underColorList, total, text } = props |
|
|
|
const { width, height, data, colorList, underColorList, total, text, textLeft,numLeft } = props |
|
|
|
const chartRef = useRef(null); |
|
|
|
let name = [], emptyName = [] |
|
|
|
// const name = data?.map(d)
|
|
|
@ -43,13 +43,13 @@ const PieChart = (props) => { |
|
|
|
a: { |
|
|
|
color: '#E9F7FF', |
|
|
|
fontSize: 14, |
|
|
|
padding:[0,2] |
|
|
|
padding: [0, 2] |
|
|
|
}, |
|
|
|
b: { |
|
|
|
fontSize: 16, |
|
|
|
fontFamily: 'YouSheBiaoTiHei', |
|
|
|
color: '#fff', |
|
|
|
padding:[0,0,0,10] |
|
|
|
padding: [0, 0, 0, 10] |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
@ -57,40 +57,17 @@ const PieChart = (props) => { |
|
|
|
grid: { |
|
|
|
left: '10%' |
|
|
|
}, |
|
|
|
// title: [
|
|
|
|
// {
|
|
|
|
// text: text,
|
|
|
|
// top: "58%",
|
|
|
|
// left: '16%',
|
|
|
|
// textStyle: {
|
|
|
|
// color: "#E9F7FF",
|
|
|
|
// fontSize: 14,
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// text: total,
|
|
|
|
// top: "40%",
|
|
|
|
// left: '10%',
|
|
|
|
// textStyle: {
|
|
|
|
// fontSize: "30",
|
|
|
|
// color: "#FFFFFF",
|
|
|
|
// fontFamily: "YouSheBiaoTiHei",
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// ],
|
|
|
|
graphic: { |
|
|
|
elements: [ |
|
|
|
{ |
|
|
|
type: 'image', |
|
|
|
style: { |
|
|
|
image: 'assets/images/quanju/chart-circle.png', |
|
|
|
width: 120, |
|
|
|
height: 120, |
|
|
|
width: 110, |
|
|
|
height: 110, |
|
|
|
align: 'center', |
|
|
|
// x:90,
|
|
|
|
// y:100
|
|
|
|
}, |
|
|
|
left: '14%', |
|
|
|
left: '12.8%', |
|
|
|
top: 'center', |
|
|
|
|
|
|
|
bounding: 'raw' |
|
|
@ -104,8 +81,8 @@ const PieChart = (props) => { |
|
|
|
fill: '#fff', |
|
|
|
font: '12px "YouSheBiaoTiHei", sans-serif', |
|
|
|
}, |
|
|
|
left: '17%', |
|
|
|
top: '55%', |
|
|
|
left: textLeft, |
|
|
|
top: '58%', |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'text', |
|
|
@ -115,7 +92,7 @@ const PieChart = (props) => { |
|
|
|
fill: '#fff', |
|
|
|
font: '20px "YouSheBiaoTiHei", sans-serif', |
|
|
|
}, |
|
|
|
left: '18.5%', |
|
|
|
left: numLeft, |
|
|
|
top: 'center', |
|
|
|
}, |
|
|
|
], |
|
|
@ -142,7 +119,7 @@ const PieChart = (props) => { |
|
|
|
data: emptyName, |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "已绿化里程统计", |
|
|
|
name: text, |
|
|
|
type: "pie", |
|
|
|
radius: ["65%", "75%"], |
|
|
|
center: ['25%', '50%'], |
|
|
|