Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
office
haoban-3
Commits
d94611aa
Commit
d94611aa
authored
Aug 05, 2022
by
shaojiawen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 图表
parent
df78582e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
29 deletions
+32
-29
newAddChart.vue
...ews/salesleads/actCodeManage/staffActCode/newAddChart.vue
+32
-29
No files found.
src/views/salesleads/actCodeManage/staffActCode/newAddChart.vue
View file @
d94611aa
...
...
@@ -12,7 +12,7 @@
<
script
>
import
*
as
G2
from
'@antv/g2'
;
import
filters
from
'@/filters/index'
;
//
import filters from '@/filters/index';
export
default
{
components
:
{},
data
()
{
...
...
@@ -65,6 +65,9 @@ export default {
nice
:
true
,
min
:
0
// type: 'linear'
},
bizDate
:
{
type
:
'cat'
}
});
this
.
chart
.
axis
(
'新增人数'
,
{
...
...
@@ -101,34 +104,34 @@ export default {
position
:
'top-left'
,
items
:
[{
name
:
'新增人数'
,
value
:
'新增人数'
,
marker
:
{
symbol
:
'line'
,
style
:
{
stroke
:
'#4B74E8'
,
lineWidth
:
12
,
lineHeight
:
8
}
}
}]
});
if
(
this
.
charData
.
length
>
1
)
{
this
.
chart
.
line
()
.
position
(
'bizDate*新增人数'
)
.
color
(
'#4B74E8'
);
// .tooltip('addNum', addNum => {
// return {
// name: '新增人数',
// value: addNum
// };
// });
}
else
if
(
this
.
charData
.
length
==
1
)
{
let
time
=
new
Date
(
this
.
charData
[
0
].
bizDate
).
getTime
();
let
start
=
{
新增人数
:
null
,
bizDate
:
filters
.
timeStampToYmd
(
time
-
86400000
)
};
let
end
=
{
新增人数
:
null
,
bizDate
:
filters
.
timeStampToYmd
(
time
+
86400000
)
};
let
list
=
[
start
,
this
.
charData
[
0
],
end
];
this
.
chart
.
data
(
list
);
this
.
chart
.
point
()
.
position
(
'bizDate*新增人数'
)
.
color
(
'#4B74E8'
);
// .tooltip('addNum', addNum => {
// return {
// name: '新增人数',
// value: addNum
// };
// });
}
//
if (this.charData.length > 1) {
this
.
chart
.
line
()
.
position
(
'bizDate*新增人数'
)
.
color
(
'#4B74E8'
);
// .tooltip('addNum', addNum => {
// return {
// name: '新增人数',
// value: addNum
// };
// });
//
} else if (this.charData.length == 1) {
//
let time = new Date(this.charData[0].bizDate).getTime();
//
let start = { 新增人数: null, bizDate: filters.timeStampToYmd(time - 86400000) };
//
let end = { 新增人数: null, bizDate: filters.timeStampToYmd(time + 86400000) };
//
let list = [start, this.charData[0], end];
//
this.chart.data(list);
//
this.chart
//
.point()
//
.position('bizDate*新增人数')
//
.color('#4B74E8');
//
// .tooltip('addNum', addNum => {
//
// return {
//
// name: '新增人数',
//
// value: addNum
//
// };
//
// });
//
}
this
.
chart
.
removeInteraction
(
'legend-filter'
);
// 自定义图例,移除默认的分类图例筛选交互
//图表绘制的最后一步,用于将图表渲染至画布
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment