From c9493b9b970414b5ec380577adf5fec9acdbf56b Mon Sep 17 00:00:00 2001
From: yuzongping <835949940@qq.com>
Date: Fri, 6 Jun 2025 15:01:33 +0800
Subject: [PATCH] =?UTF-8?q?=E9=A5=BC=E5=9B=BE=E5=92=8C=E7=BA=BF=E5=9B=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/charts/pie/index.html | 6 +++-
src/components/charts/pie/index.js | 52 ++++++++++------------------
src/components/charts/pie/index.scss | 25 +++++++++++--
3 files changed, 46 insertions(+), 37 deletions(-)
diff --git a/src/components/charts/pie/index.html b/src/components/charts/pie/index.html
index d60fced..755e112 100644
--- a/src/components/charts/pie/index.html
+++ b/src/components/charts/pie/index.html
@@ -1 +1,5 @@
-
+
+
diff --git a/src/components/charts/pie/index.js b/src/components/charts/pie/index.js
index 9110512..3ec1406 100644
--- a/src/components/charts/pie/index.js
+++ b/src/components/charts/pie/index.js
@@ -11,12 +11,24 @@ export default {
default: function () {
return [
{
- name: '1月',
- value: '10'
+ value: 2154,
+ unit: '万元',
+ name: "项目一",
},
{
- name: '2月',
- value: '19'
+ value: 3854,
+ unit: '万元',
+ name: "项目二",
+ },
+ {
+ value: 3854,
+ unit: '万吨',
+ name: "项目三",
+ },
+ {
+ value: 3854,
+ unit: '万吨',
+ name: "项目四",
}
];
}
@@ -49,26 +61,7 @@ export default {
chartSetOption () {
var scale = 1;
var echartData = [
- {
- value: 2154,
- unit: '万元',
- name: "经营收入",
- },
- {
- value: 3854,
- unit: '万元',
- name: "投资收益",
- },
- {
- value: 3854,
- unit: '万吨',
- name: "补助收入",
- },
- {
- value: 3854,
- unit: '万吨',
- name: "其他收入",
- }
+ ...this.data
];
var rich = {
yellow: {
@@ -100,12 +93,6 @@ export default {
height: 0,
},
};
- let xAxisData = [];
- let data = [];
- this.data.forEach(item => {
- xAxisData.push(item.name)
- data.push(item.value)
- });
const option = {
title: [
{
@@ -135,9 +122,8 @@ export default {
{
name: "",
type: "pie",
- radius: ["42%", "60%"],
- hoverAnimation: false,
- color: ["#c487ee", "#deb140", "#49dff0", "#034079", "#6f81da", "#00ffb4"],
+ radius: ["48%", "70%"],
+ color: ["rgba(15, 252, 252, 1)", "rgba(134, 91, 252, 1)", "rgba(49, 129, 246, 1)", "rgba(29, 197, 104, 1)"],
label: {
normal: {
formatter: function (params, ticket, callback) {
diff --git a/src/components/charts/pie/index.scss b/src/components/charts/pie/index.scss
index b89d9dc..be7abd0 100644
--- a/src/components/charts/pie/index.scss
+++ b/src/components/charts/pie/index.scss
@@ -1,6 +1,25 @@
-.chart {
- overflow: visible;
+.pie_full {
width: 100%;
height: 100%;
- z-index: 2;
+ position: relative;
+
+ .chart {
+ overflow: visible;
+ width: 100%;
+ height: 100%;
+ z-index: 2;
+ }
+
+ .cir {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 200px;
+ height: 200px;
+ border-radius: 50%;
+ border: 1px solid rgba(49, 129, 246, 1);
+ box-shadow: inset 0 0 10px 2px rgba(27, 123, 204, 0.8);
+ /* 添加内发光效果 */
+ }
}
\ No newline at end of file