Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
gh
/
dj-data-view
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 530d57fd
authored
Oct 24, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
ac4bd30c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
74 additions
and
21 deletions
src/assets/css/index.scss
src/components/Legend.vue
src/components/PieChart.vue
src/mixins/clientMixin.js
src/views/customer/area.vue
src/views/customer/brand.vue
src/views/customer/store.vue
src/assets/css/index.scss
View file @
530d57f
...
...
@@ -108,7 +108,8 @@ img {
}
.container
{
margin
:
0
8px
;
height
:
8
.54vh
;
margin
:
8px
6px
8px
8px
;
}
.empty
{
...
...
src/components/Legend.vue
0 → 100644
View file @
530d57f
<
template
>
<div
class=
"legend"
>
<div
class=
"legend-item flex"
v-for=
"item in 5"
>
<span></span>
湘
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
'Legend'
,
data
()
{
return
{}
},
mounted
()
{},
methods
:
{}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.legend
{
display
:
flex
;
align-items
:
center
;
flex-wrap
:
wrap
;
width
:
7.7vw
;
height
:
8.54vh
;
margin-left
:
0.42vw
;
.legend-item
{
width
:
3.68vw
;
height
:
2.44vh
;
background
:
#0d133b
;
align-items
:
center
;
font-size
:
9px
;
color
:
#fff
;
margin
:
0
2px
2px
0
;
box-sizing
:
border-box
;
line-height
:
2.44vh
;
margin
:
2px
2px
0
0
;
span
{
width
:
5px
;
height
:
5px
;
background
:
#bf98ff
;
border-radius
:
50%
;
margin
:
4px
;
}
}
}
</
style
>
src/components/PieChart.vue
View file @
530d57f
...
...
@@ -4,10 +4,10 @@
<div
class=
"center-content"
:style=
"
{ fontSize: size }">
<div
:class=
"[id, 'center-content-num', 'center-content-num-color']"
></div>
</div>
<div
class=
"content-desc"
>
<
!--
<
div
class=
"content-desc"
>
<div
class=
"content-desc-icon"
:style=
"
{ background: descColor }">
</div>
{{
numDesc
}}
</div>
</div>
-->
</div>
</
template
>
...
...
@@ -27,7 +27,7 @@ export default {
},
height
:
{
type
:
String
,
default
:
'
12.7
vh'
default
:
'
8.54
vh'
},
list
:
{
type
:
Array
,
...
...
@@ -35,7 +35,7 @@ export default {
},
radius
:
{
type
:
Array
,
default
:
()
=>
[
'
50%'
,
'70
%'
]
default
:
()
=>
[
'
60%'
,
'89
%'
]
},
colors
:
{
type
:
Array
,
...
...
src/mixins/clientMixin.js
View file @
530d57f
...
...
@@ -2,7 +2,13 @@ import { changeMixin } from './index'
export
default
{
data
()
{
return
{
clientData
:
[],
clientData
:
[
{
value
:
1048
,
name
:
'Search Engine'
},
{
value
:
735
,
name
:
'Direct'
},
{
value
:
580
,
name
:
'Email'
},
{
value
:
484
,
name
:
'Union Ads'
},
{
value
:
300
,
name
:
'Video Ads'
}
],
brandList
:
[],
distributionRank
:
''
,
isBrand
:
false
,
...
...
@@ -37,7 +43,7 @@ export default {
this
.
clientData
.
push
({
name
:
item
,
// value: distribution[item]
value
:
(
distribution
[
item
]
/
total
*
100
).
toFixed
(
1
)
value
:
(
(
distribution
[
item
]
/
total
)
*
100
).
toFixed
(
1
)
})
})
console
.
log
(
this
.
clientData
)
...
...
src/views/customer/area.vue
View file @
530d57f
...
...
@@ -6,7 +6,8 @@
<span>
区域分布
</span>
</div>
<div
class=
"container flex"
>
<pie-chart
:id=
"chart.id"
:list=
"clientData"
></pie-chart>
<Legend></Legend>
</div>
</div>
</
template
>
...
...
@@ -18,7 +19,9 @@ export default {
mixins
:
[
clientMixin
],
data
()
{
return
{
chart
:
{
id
:
'area'
,
}
}
}
}
...
...
src/views/customer/brand.vue
View file @
530d57f
...
...
@@ -6,7 +6,8 @@
<span>
品牌分布
</span>
</div>
<div
class=
"container flex"
>
<pie-chart
:id=
"chart.id"
:list=
"clientData"
></pie-chart>
<Legend></Legend>
</div>
</div>
</
template
>
...
...
@@ -19,7 +20,7 @@ export default {
return
{
type
:
'gender'
,
chart
:
{
id
:
'
sex-pie
'
,
id
:
'
brand
'
,
colors
:
[
'#EB6001'
,
'#BF98FF'
,
'#FF6E76'
]
}
}
...
...
src/views/customer/store.vue
View file @
530d57f
<!--
* @Description: 客户购车年限
* @Author: huyue
* @Date: 2022-06-23 15:06:32
* @LastEditors: huyue
* @LastEditTime: 2022-06-23 17:03:19
-->
<
template
>
<div>
<div
class=
"title title-icon"
>
<span
class=
"icon"
></span>
<span>
门店类型
</span>
</div>
<div
class=
"container flex"
>
<div
class=
"container flex"
>
<pie-chart
:id=
"chart.id"
:list=
"clientData"
></pie-chart>
<Legend></Legend>
</div>
</div>
</
template
>
...
...
@@ -26,7 +20,7 @@ export default {
return
{
type
:
'buycarRange'
,
chart
:
{
id
:
'
car-pi
e'
id
:
'
stor
e'
}
}
}
...
...
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