Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
glsk-data-view-pd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 22e4040f
authored
Jul 18, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改饼图
1 parent
f922bc54
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
src/components/PieChart.vue
src/views/home/solar/PurchaseProgress.vue
src/views/home/solar/PurchasePropertion.vue
src/components/PieChart.vue
View file @
22e4040
...
@@ -86,7 +86,8 @@ export default {
...
@@ -86,7 +86,8 @@ export default {
list
.
forEach
(
item
=>
{
list
.
forEach
(
item
=>
{
this
.
viewData
.
push
({
this
.
viewData
.
push
({
name
:
item
[
keys
[
0
]],
name
:
item
[
keys
[
0
]],
value
:
item
[
keys
[
1
]]
value
:
item
[
keys
[
1
]],
avarage
:
item
[
keys
[
2
]]
})
})
})
})
},
},
...
@@ -96,7 +97,7 @@ export default {
...
@@ -96,7 +97,7 @@ export default {
window
.
addEventListener
(
'resize'
,
()
=>
{
window
.
addEventListener
(
'resize'
,
()
=>
{
this
.
echartsPie
.
resize
()
this
.
echartsPie
.
resize
()
})
})
const
_this
=
this
// 指定图表的配置项和数据
// 指定图表的配置项和数据
this
.
option
=
{
this
.
option
=
{
// tooltip: {
// tooltip: {
...
@@ -125,7 +126,12 @@ export default {
...
@@ -125,7 +126,12 @@ export default {
fontSize
:
this
.
size
,
fontSize
:
this
.
size
,
fontWeight
:
'bold'
,
fontWeight
:
'bold'
,
color
:
'#fff'
,
color
:
'#fff'
,
formatter
(
param
)
{
formatter
(
params
)
{
const
_dataIndex
=
params
.
dataIndex
const
_avarage
=
_this
.
list
[
_dataIndex
].
averprice
console
.
log
(
_this
.
list
,
_avarage
);
if
(
_avarage
)
return
`
${
params
.
name
}
\n均价¥
${
_avarage
||
''
}
`
return
`
${
params
.
name
}
`
}
}
}
}
},
},
...
...
src/views/home/solar/PurchaseProgress.vue
View file @
22e4040
...
@@ -70,7 +70,7 @@ export default {
...
@@ -70,7 +70,7 @@ export default {
this
.
openMessage
(
'获取采购进度占比失败'
)
this
.
openMessage
(
'获取采购进度占比失败'
)
return
return
}
}
this
.
progressData
=
res
.
data
.
dataList
.
slice
(
0
,
3
)
||
[]
this
.
progressData
=
res
.
data
.
dataList
||
[]
})
})
}
}
}
}
...
...
src/views/home/solar/PurchasePropertion.vue
View file @
22e4040
...
@@ -23,7 +23,7 @@ export default {
...
@@ -23,7 +23,7 @@ export default {
// 采购占比饼图结构
// 采购占比饼图结构
propertionChart
:
{
propertionChart
:
{
id
:
'propertion'
,
id
:
'propertion'
,
keys
:
[
'goodsname'
,
'purchaseamount'
],
keys
:
[
'goodsname'
,
'purchaseamount'
,
'averprice'
],
height
:
'15.34vh'
,
height
:
'15.34vh'
,
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
]
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
]
},
},
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment