Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
ec-report-refactor
Project
Project
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
lihuizhen
ec-report-refactor
Commits
6c97a118
Commit
6c97a118
authored
Aug 29, 2023
by
leon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: tooltip position
parent
e4979a10
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
common.js
utils/common.js
+22
-2
No files found.
utils/common.js
View file @
6c97a118
...
...
@@ -240,10 +240,30 @@ const install = (Vue, vm) => {
const
dealTooltip
=
(
tooltip
)
=>
{
if
(
!
tooltip
)
{
return
}
}
tooltip
=
{
...
tooltip
,
position
(
point
,
params
,
dom
,
rect
,
size
)
{
let
x
=
point
[
0
];
let
y
=
point
[
1
];
const
{
contentSize
,
viewSize
}
=
size
;
const
maxX
=
viewSize
[
0
]
-
contentSize
[
0
];
if
(
x
>
maxX
)
{
x
-=
contentSize
[
0
];
}
const
maxY
=
viewSize
[
1
]
-
contentSize
[
1
];
if
(
y
>
maxY
)
{
y
-=
contentSize
[
1
];
}
if
(
y
<
0
)
{
y
=
0
}
return
[
x
,
y
];
}
}
if
(
tooltip
.
formatter
&&
tooltip
.
formatter
.
length
)
{
return
{
...
tooltip
,
...
tooltip
,
formatter
:
(
val
)
=>
{
return
converFunction
(
tooltip
.
formatter
,
val
)
},
...
...
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