Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcjg-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
1a0b2b79
authored
2023-03-15 16:41:51 +0800
by
xiaomiao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
饼图调整
1 parent
d85cf35a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
16 deletions
src/components/Echart/Rose/Chart.vue
src/components/Echart/Rose/index.vue
src/components/Echart/Rose/Chart.vue
View file @
1a0b2b7
...
...
@@ -19,8 +19,8 @@
},
props
:
{
cdata
:
{
type
:
Object
,
default
:
()
=>
(
{}
),
type
:
Array
,
default
:
()
=>
(
[]
),
},
},
watch
:
{
...
...
@@ -47,6 +47,7 @@
{
name
:
"Access From"
,
type
:
"pie"
,
radius
:
'60%'
,
avoidLabelOverlap
:
true
,
label
:
{
formatter
:
(
params
)
=>
{
...
...
@@ -54,10 +55,17 @@
},
position
:
"outer"
,
alignTo
:
"edge"
,
margin
:
5
margin
:
10
,
normal
:
{
show
:
true
,
textStyle
:
{
fontSize
:
12
}
},
},
data
:
newData
.
seriesData
,
data
:
newData
,
}
],
};
...
...
src/components/Echart/Rose/index.vue
View file @
1a0b2b7
...
...
@@ -10,9 +10,7 @@
export
default
{
data
()
{
return
{
cdata
:
{
seriesData
:
[],
},
cdata
:
[],
getdata
:
[],
};
},
...
...
@@ -22,44 +20,44 @@
mounted
()
{
this
.
addhousetotal
();
window
.
addEventListener
(
"resize"
,
()
=>
{
this
.
get
data
=
[];
this
.
c
data
=
[];
this
.
addhousetotal
();
});
},
methods
:
{
async
addhousetotal
()
{
if
(
this
.
getdata
.
length
==
0
)
{
if
(
this
.
cdata
==
0
)
{
this
.
getdata
=
[];
try
{
let
{
result
:
res
}
=
await
work
.
addhousetotal
();
res
.
map
((
item
)
=>
{
return
this
.
cdata
.
seriesData
.
push
({
return
this
.
cdata
.
push
({
name
:
`
${
item
.
fwyt
+
'('
+
item
.
fwxz
}
)`
,
value
:
item
.
mj
,
});
});
let
delarr
=
this
.
cdata
.
sort
(
this
.
up
)
this
.
setadat
(
delarr
)
}
catch
(
error
)
{
console
.
log
(
"error"
,
error
);
}
}
let
delarr
=
this
.
cdata
.
seriesData
.
sort
(
this
.
up
)
this
.
setadat
(
delarr
)
},
// 处理数据方法
setadat
(
delarr
)
{
this
.
cdata
.
seriesData
=
delarr
.
splice
(
0
,
6
);
this
.
cdata
=
delarr
.
splice
(
0
,
6
);
let
sum
=
0
for
(
var
i
=
0
;
i
<
delarr
.
length
;
i
++
)
{
sum
=
sum
+
delarr
[
i
].
value
}
}
sum
=
sum
.
toFixed
(
2
)
this
.
cdata
.
seriesData
.
push
({
this
.
cdata
.
push
({
name
:
"其他(其他种类)"
,
values
:
"其他种类"
,
value
:
sum
,
...
...
Please
register
or
sign in
to post a comment