This commit is contained in:
zk
2023-12-15 18:33:04 +08:00
parent d614f10bb5
commit 2cc8886c2d
31 changed files with 820 additions and 582 deletions
+47 -28
View File
@@ -1,37 +1,56 @@
export function screenPie(chartData, total, color, formatter) {
return {
title: {
text: '总人数',
color: color,
tooltip: {
trigger: 'item',
show: true,
textStyle: {
fontSize: 14,
color: '#ffffff',
fontWeight: 'normal',
align: 'center',
color: '#fff',
},
subtext: total + '',
x: '38%',
y: '42%',
subtextStyle: {
backgroundColor: 'rgba(50,50,50,0.7)',
borderColor: '#1b7ef2',
},
legend: {
left: '74%',
top: 'center',
orient: 'vertical',
icon: 'circle',
itemGap: 8,
textStyle: {
color: '#ffffff',
fontSize: 24,
fontWeight: 'bold',
fontSize: 16,
},
},
// graphic: [
// {
// //环形图中间添加文字
// type: 'text', //通过不同top值可以设置上下显示
// left: 'center',
// top: 'center',
// style: {
// text: 45465456,
// textAlign: 'center',
// fill: '#1E7CE8', //文字的颜色
// fontSize: 20,
// lineHeight: 20,
// },
// },
// ],
series: [
{
type: 'pie',
// radius: ['50%', '86%'],
// center: ['42%', '55%'],
radius: ['50%', '76%'],
center: ['42%', '49%'],
avoidLabelOverlap: false,
label: {
show: true,
position: 'outside',
formatter: formatter,
color: '#ffffff',
fontSize: 14,
},
labelLine: {
show: true,
length: 6,
length2: 20,
minTurnAngle: 120,
},
data: chartData,
},
],
};
}
//左侧圆
export function circleRing(chartData, total, color, formatter) {
return {
color: color,
tooltip: {
trigger: 'item',
@@ -56,7 +75,7 @@ export function screenPie(chartData, total, color, formatter) {
series: [
{
type: 'pie',
radius: ['50%', '86%'],
radius: ['50%', '82%'],
center: ['42%', '55%'],
avoidLabelOverlap: false,
label: {