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 2f196a23
authored
Aug 21, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
样式调整
1 parent
94c9e556
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
13 deletions
src/views/operational/components/Analyse.vue
src/views/operational/components/AreaSaas.vue
src/views/operational/components/BarChart.vue
src/views/operational/components/BrandSaas.vue
src/views/operational/components/options.js
src/views/operational/components/Analyse.vue
View file @
2f196a2
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
</div>
</div>
</div>
</div>
<div
class=
"container"
>
<div
class=
"container"
>
<BarChart
domId=
"analyseChart"
:revese=
"true"
boxHeight=
"14.54vh"
:analysisList=
"analysisList"
></BarChart>
<BarChart
domId=
"analyseChart"
:revese=
"true"
boxHeight=
"14.54vh"
:analysisList=
"analysisList"
:colorList=
"colorList"
></BarChart>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -31,7 +31,8 @@ export default {
...
@@ -31,7 +31,8 @@ export default {
data
()
{
data
()
{
return
{
return
{
analysisList
:
{},
analysisList
:
{},
isShow
:
true
isShow
:
true
,
colorList
:
[
'#5C56FF'
,
'#22D8FF'
]
}
}
},
},
mounted
()
{
mounted
()
{
...
...
src/views/operational/components/AreaSaas.vue
View file @
2f196a2
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<span>
区域分布
</span>
<span>
区域分布
</span>
</div>
</div>
<div
class=
"container"
>
<div
class=
"container"
>
<BarChart
domId=
"areaChart"
:analysisList=
"areaList"
></BarChart>
<BarChart
domId=
"areaChart"
:analysisList=
"areaList"
:colorList=
"colorList"
></BarChart>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -17,7 +17,9 @@ export default {
...
@@ -17,7 +17,9 @@ export default {
BarChart
BarChart
},
},
data
()
{
data
()
{
return
{}
return
{
colorList
:
[
'#22D8FF'
,
'#223FA9'
,
'#071735'
]
}
},
},
props
:
{
props
:
{
areaList
:
{
areaList
:
{
...
...
src/views/operational/components/BarChart.vue
View file @
2f196a2
...
@@ -50,6 +50,9 @@ export default {
...
@@ -50,6 +50,9 @@ export default {
type
:
Number
,
type
:
Number
,
default
:
0
default
:
0
},
},
colorList
:
{
type
:
Array
},
tooltipFormatterObj
:
{
tooltipFormatterObj
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
{
default
:
()
=>
{
...
@@ -103,13 +106,13 @@ export default {
...
@@ -103,13 +106,13 @@ export default {
watch
:
{
watch
:
{
analysisList
:
{
analysisList
:
{
handler
()
{
handler
()
{
const
{
rotate
,
analysisList
}
=
this
const
{
rotate
,
analysisList
,
colorList
}
=
this
const
obj
=
{
const
obj
=
{
rotate
,
rotate
,
analysisList
,
analysisList
,
ValueAnalysis
ValueAnalysis
}
}
this
.
lineOptions
=
this
.
revese
?
getBarReverseOptions
(
obj
)
:
getBarOptions
(
obj
)
this
.
lineOptions
=
this
.
revese
?
getBarReverseOptions
(
obj
,
colorList
)
:
getBarOptions
(
obj
,
colorList
)
this
.
chartBindEvent
()
this
.
chartBindEvent
()
},
},
deep
:
true
deep
:
true
...
...
src/views/operational/components/BrandSaas.vue
View file @
2f196a2
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<span>
品牌分布
</span>
<span>
品牌分布
</span>
</div>
</div>
<div
class=
"container"
>
<div
class=
"container"
>
<BarChart
domId=
"brandChart"
:rotate=
"30"
:analysisList=
"brandList"
></BarChart>
<BarChart
domId=
"brandChart"
:rotate=
"30"
:analysisList=
"brandList"
:colorList=
"colorList"
></BarChart>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -17,7 +17,9 @@ export default {
...
@@ -17,7 +17,9 @@ export default {
BarChart
BarChart
},
},
data
()
{
data
()
{
return
{}
return
{
colorList
:
[
'#2AD191'
,
'#0E958D'
,
'#071735'
]
}
},
},
props
:
{
props
:
{
brandList
:
{
brandList
:
{
...
...
src/views/operational/components/options.js
View file @
2f196a2
...
@@ -6,11 +6,11 @@
...
@@ -6,11 +6,11 @@
* @FilePath: \dj-data-view\src\components\barOptions.js
* @FilePath: \dj-data-view\src\components\barOptions.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
*/
import
*
as
echarts
from
'echarts'
import
utils
from
'../../../utils/util'
import
utils
from
'../../../utils/util'
function
getBarOptions
(
obj
)
{
function
getBarOptions
(
obj
,
colorList
)
{
const
{
analysisList
,
rotate
}
=
obj
const
{
analysisList
,
rotate
}
=
obj
const
num
=
analysisList
.
map
(
item
=>
item
.
ratio
*
100
)
const
num
=
analysisList
.
map
(
item
=>
item
.
ratio
*
100
)
console
.
log
(
num
)
const
name
=
analysisList
.
map
(
item
=>
item
.
name
)
const
name
=
analysisList
.
map
(
item
=>
item
.
name
)
var
options
=
{
var
options
=
{
xAxis
:
{
xAxis
:
{
...
@@ -56,8 +56,28 @@ function getBarOptions(obj) {
...
@@ -56,8 +56,28 @@ function getBarOptions(obj) {
{
{
type
:
'bar'
,
type
:
'bar'
,
symbol
:
'circle'
,
symbol
:
'circle'
,
backgroundStyle
:
{
// backgroundStyle: {
color
:
'#6578FF'
// color: '#6578FF'
// },
itemStyle
:
{
barBorderRadius
:
[
2
,
2
,
0
,
0
],
// 柱体圆角
color
:
function
(
params
)
{
// var colorItem = []
return
new
echarts
.
graphic
.
LinearGradient
(
0
,
0
,
0
,
1
,
[{
// 代表渐变色从正上方开始
offset
:
0
,
// offset范围是0~1,用于表示位置,0是指0%处的颜色
color
:
colorList
[
0
]
},
// 柱图渐变色
{
offset
:
0.5
,
// 指100%处的颜色
color
:
colorList
[
1
]
},
{
offset
:
1
,
// 指100%处的颜色
color
:
colorList
[
2
]
}]
)
}
},
},
barWidth
:
'35%'
,
barWidth
:
'35%'
,
data
:
num
data
:
num
...
@@ -66,7 +86,7 @@ function getBarOptions(obj) {
...
@@ -66,7 +86,7 @@ function getBarOptions(obj) {
}
}
return
options
return
options
}
}
function
getBarReverseOptions
(
obj
)
{
function
getBarReverseOptions
(
obj
,
colorList
)
{
const
{
analysisList
,
ValueAnalysis
}
=
obj
const
{
analysisList
,
ValueAnalysis
}
=
obj
// const value = Object.values(analysisList)
// const value = Object.values(analysisList)
const
entries
=
Object
.
entries
(
analysisList
)
const
entries
=
Object
.
entries
(
analysisList
)
...
@@ -151,6 +171,20 @@ function getBarReverseOptions(obj) {
...
@@ -151,6 +171,20 @@ function getBarReverseOptions(obj) {
lineHeight
:
16
lineHeight
:
16
}
}
}
}
},
barBorderRadius
:
[
2
,
2
,
0
,
0
],
// 柱体圆角
color
:
function
(
params
)
{
// var colorItem = []
return
new
echarts
.
graphic
.
LinearGradient
(
0
,
0
,
0
,
1
,
[{
// 代表渐变色从正上方开始
offset
:
0
,
// offset范围是0~1,用于表示位置,0是指0%处的颜色
color
:
colorList
[
0
]
},
// 柱图渐变色
{
offset
:
1
,
// 指100%处的颜色
color
:
colorList
[
1
]
}]
)
}
}
},
},
data
:
value
.
map
(
item
=>
item
.
value
)
data
:
value
.
map
(
item
=>
item
.
value
)
...
...
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