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 087bfa1c
authored
Jul 18, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
饼图样式调整
1 parent
b5778096
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
49 deletions
src/components/PieChart.vue
src/views/home/solar/PurchasePropertion.vue
src/views/home/solar/RightViewContent.vue
src/views/solarDetail/MerchantsPropotion.vue
src/components/PieChart.vue
View file @
087bfa1
...
...
@@ -13,6 +13,7 @@
<
script
>
import
*
as
echarts
from
'echarts'
import
utils
from
'@/utils/util.js'
export
default
{
name
:
'PieChart'
,
...
...
@@ -44,6 +45,10 @@ export default {
size
:
{
type
:
String
,
default
:
'0.6vw'
},
formatter
:
{
type
:
Boolean
,
default
:
false
}
},
...
...
@@ -75,8 +80,7 @@ export default {
}
},
mounted
()
{
},
mounted
()
{},
methods
:
{
// 初始化数据
...
...
@@ -128,10 +132,19 @@ export default {
color
:
'#fff'
,
formatter
(
params
)
{
const
_dataIndex
=
params
.
dataIndex
const
_avarage
=
_this
.
list
[
_dataIndex
].
averprice
console
.
log
(
_this
.
list
,
_avarage
);
if
(
_avarage
)
return
`
${
params
.
name
}
\n均价¥
${
_avarage
||
''
}
`
const
_purchaseamount
=
utils
.
numAddSymbol
(
_this
.
list
[
_dataIndex
].
purchaseamount
)
const
_avarage
=
utils
.
numAddSymbol
(
_this
.
list
[
_dataIndex
].
averprice
)
console
.
log
(
_purchaseamount
,
_avarage
)
if
(
_this
.
formatter
)
return
`{a|¥
${
_purchaseamount
}
}\n{b|均价¥
${
_avarage
}
}`
return
`
${
params
.
name
}
`
},
rich
:
{
a
:
{
color
:
'#c8c8c8'
},
b
:
{
color
:
'#ffffff66'
}
}
}
},
...
...
src/views/home/solar/PurchasePropertion.vue
View file @
087bfa1
...
...
@@ -23,34 +23,35 @@ export default {
// 采购占比饼图结构
propertionChart
:
{
id
:
'propertion'
,
keys
:
[
'goodsname'
,
'purchaseamount'
,
'averprice'
],
keys
:
[
'goodsname'
,
'purchaseamount'
],
height
:
'15.34vh'
,
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
]
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
],
formatter
:
true
},
// 采购占比数据
propertionData
:
[],
propertionLegend
:
[
{
name
:
'goodsname'
,
width
:
'
2.5
vw'
width
:
'
11.11
vw'
},
{
name
:
'rate'
,
type
:
'decimal'
,
width
:
'1.88vw'
},
{
name
:
'purchaseamount'
,
hasIcon
:
'¥'
,
type
:
'number'
,
width
:
'4.06vw'
},
{
name
:
'averprice'
,
hasIcon
:
'均价¥'
,
type
:
'number'
,
width
:
'6.24vw'
}
//
{
//
name: 'purchaseamount',
//
hasIcon: '¥',
//
type: 'number',
//
width: '4.06vw'
//
},
//
{
//
name: 'averprice',
//
hasIcon: '均价¥',
//
type: 'number',
//
width: '6.24vw'
//
}
]
}
},
...
...
src/views/home/solar/RightViewContent.vue
View file @
087bfa1
...
...
@@ -3,7 +3,7 @@
-->
<
template
>
<div
class=
"main-box"
>
<pie-chart
class=
"pie-chart"
:id=
"chart.id"
:list=
"listData"
:keys=
"chart.keys"
:height=
"chart.height"
:colors=
"chart.colors"
></pie-chart>
<pie-chart
class=
"pie-chart"
:id=
"chart.id"
:list=
"listData"
:keys=
"chart.keys"
:
formatter=
"chart.formatter"
:
height=
"chart.height"
:colors=
"chart.colors"
></pie-chart>
<Legend
class=
"legend"
:list=
"listData"
:legentList=
"legentList"
:colors=
"legendColors"
></Legend>
</div>
</
template
>
...
...
src/views/solarDetail/MerchantsPropotion.vue
View file @
087bfa1
...
...
@@ -55,60 +55,62 @@ export default {
id
:
'shopmall'
,
keys
:
[
'goodsname'
,
'purchaseamount'
],
height
:
'16vh'
,
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
]
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
],
formatter
:
true
},
shopmallLegend
:
[
{
name
:
'goodsname'
,
width
:
'
7
vw'
width
:
'
15.28
vw'
},
{
name
:
'rate'
,
type
:
'decimal'
,
width
:
'3vw'
},
{
name
:
'purchaseamount'
,
hasIcon
:
'¥'
,
type
:
'number'
,
width
:
'5vw'
},
{
name
:
'averprice'
,
hasIcon
:
'均价¥'
,
type
:
'number'
,
width
:
'5vw'
}
//
{
//
name: 'purchaseamount',
//
hasIcon: '¥',
//
type: 'number',
//
width: '5vw'
//
},
//
{
//
name: 'averprice',
//
hasIcon: '均价¥',
//
type: 'number',
//
width: '5vw'
//
}
],
// 自采饼图结构
selfPickChart
:
{
id
:
'selfPick'
,
keys
:
[
'goodsname'
,
'purchaseamount'
],
height
:
'16vh'
,
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
]
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
],
formatter
:
true
},
selfPickLegend
:
[
{
name
:
'goodsname'
,
width
:
'
7
vw'
width
:
'
15.28
vw'
},
{
name
:
'rate'
,
type
:
'decimal'
,
width
:
'3vw'
},
{
name
:
'purchaseamount'
,
hasIcon
:
'¥'
,
type
:
'number'
,
width
:
'5vw'
},
{
name
:
'averprice'
,
hasIcon
:
'均价¥'
,
type
:
'number'
,
width
:
'5vw'
}
//
{
//
name: 'purchaseamount',
//
hasIcon: '¥',
//
type: 'number',
//
width: '5vw'
//
},
//
{
//
name: 'averprice',
//
hasIcon: '均价¥',
//
type: 'number',
//
width: '5vw'
//
}
]
}
},
...
...
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