Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
dj-scrm-wx-work-attachment-report
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
4
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 52cec0e5
authored
Feb 24, 2022
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
动态生成各个标度点的间距
1 parent
539c3a8f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
src/components/Chart.vue
src/components/Chart.vue
View file @
52cec0e
...
...
@@ -88,6 +88,7 @@ export default {
chart
:
null
,
lineChart
:
null
,
lineChartCustomer
:
null
,
tickInterval
:
5
,
orderSource
:
{
1
:
'商城订单'
,
2
:
'直播订单'
,
...
...
@@ -251,7 +252,8 @@ export default {
})
this
.
chart
.
render
()
},
lineCustomerChart
(
id
=
'lineCustomerChart'
)
{
async
lineCustomerChart
(
id
=
'lineCustomerChart'
)
{
await
this
.
dynamicTick
()
//动态生成各个标度点的间距
this
.
lineChartCustomer
&&
this
.
lineChartCustomer
.
clear
()
this
.
lineChartCustomer
=
null
this
.
lineChartCustomer
=
new
F2
.
Chart
({
...
...
@@ -285,7 +287,7 @@ export default {
value
:
{
type
:
'linear'
,
nice
:
true
,
minTickInterval
:
2
tickInterval
:
this
.
tickInterval
}
})
this
.
lineChartCustomer
.
axis
(
'dayTime'
,
{
...
...
@@ -348,6 +350,26 @@ export default {
offsetY
:
-
165
})
this
.
lineChartCustomer
.
render
()
},
dynamicTick
()
{
let
entMicroCountData
=
[]
//新增企微客户数
let
newlyCustomerCountData
=
[]
let
entMicroCount
let
newlyCustomerCount
let
tickData
=
[...
this
.
trendChartList
]
tickData
.
forEach
(
i
=>
{
entMicroCountData
.
push
(
i
.
entMicroCount
)
newlyCustomerCountData
.
push
(
i
.
newlyCustomerCount
)
})
entMicroCountData
.
sort
((
a
,
b
)
=>
{
return
b
-
a
})
newlyCustomerCountData
.
sort
((
a
,
b
)
=>
{
return
b
-
a
})
entMicroCount
=
entMicroCountData
[
0
]
newlyCustomerCount
=
newlyCustomerCountData
[
0
]
this
.
tickInterval
=
Math
.
ceil
(
entMicroCount
>
newlyCustomerCount
?
entMicroCount
/
5
:
newlyCustomerCount
/
5
)
}
}
}
...
...
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