Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
graph
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
李伟@五瓣科技
graph
Commits
cdec2c0b
Commit
cdec2c0b
authored
Jul 04, 2022
by
wenli.huang@wuban.net.cn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
up
parent
28f48cc6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
5 deletions
+32
-5
App.js
src/App.js
+32
-5
No files found.
src/App.js
View file @
cdec2c0b
...
@@ -60,10 +60,10 @@ class App extends Component {
...
@@ -60,10 +60,10 @@ class App extends Component {
yAxis
:
'
0
'
,
yAxis
:
'
0
'
,
label
:
{
label
:
{
show
:
true
,
show
:
true
,
lineHeight
:
25
,
lineHeight
:
10
,
// position: 'start', // 改变label位置
// position: 'start', // 改变label位置
position
:
'
insideMiddleTop
'
,
position
:
'
insideMiddleTop
'
,
formatter
:
item
.
Value
,
// 格式化标签文本
formatter
:
item
.
Value
,
// 格式化标签文本
},
},
lineStyle
:
{
color
:
'
green
'
,
type
:
'
solid
'
,
with
:
30
},
lineStyle
:
{
color
:
'
green
'
,
type
:
'
solid
'
,
with
:
30
},
},
},
...
@@ -171,7 +171,7 @@ class App extends Component {
...
@@ -171,7 +171,7 @@ class App extends Component {
markLine
:{
markLine
:{
symbol
:
'
circle
'
,
symbol
:
'
circle
'
,
data
:
markline
,
data
:
markline
,
}
}
});
});
});
});
...
@@ -205,7 +205,6 @@ class App extends Component {
...
@@ -205,7 +205,6 @@ class App extends Component {
min
:
data
.
result
.
AxisX
.
AxisXBegin
,
min
:
data
.
result
.
AxisX
.
AxisXBegin
,
max
:
data
.
result
.
AxisX
.
AxisXEnd
,
max
:
data
.
result
.
AxisX
.
AxisXEnd
,
interval
:(
data
.
result
.
AxisX
.
AxisXEnd
-
data
.
result
.
AxisX
.
AxisXBegin
)
/
5
,
interval
:(
data
.
result
.
AxisX
.
AxisXEnd
-
data
.
result
.
AxisX
.
AxisXBegin
)
/
5
,
// offset:-75,
axisLine
:{
axisLine
:{
show
:
true
,
show
:
true
,
symbol
:
[
'
none
'
,
'
arrow
'
]
symbol
:
[
'
none
'
,
'
arrow
'
]
...
@@ -334,10 +333,34 @@ class App extends Component {
...
@@ -334,10 +333,34 @@ class App extends Component {
var
yy
=
event
.
pageY
+
15
var
yy
=
event
.
pageY
+
15
elementDiv
.
style
.
top
=
yy
+
'
px
'
elementDiv
.
style
.
top
=
yy
+
'
px
'
elementDiv
.
style
.
left
=
xx
+
'
px
'
elementDiv
.
style
.
left
=
xx
+
'
px
'
}
}
}
}
}
}
})
})
myChart
.
on
(
'
mousemove
'
,
function
(
params
)
{
if
(
params
.
componentType
==
"
markLine
"
){
var
elementDiv
=
document
.
querySelector
(
'
#extension
'
)
var
elementStyle
=
`position: absolute;
margin-left:35px;
z-index: 99999;
color: #fff;
font-size: 12px;
padding: 5px;
display: inline;
border-radius: 4px;background-color: #303133;
box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 8px`
elementDiv
.
style
.
cssText
=
elementStyle
elementDiv
.
innerHTML
=
moment
(
parseInt
(
params
.
data
.
xAxis
/
1000000
)).
format
(
'
YYYY-MM-DD HH:mm:ss.SSS
'
)
document
.
querySelector
(
'
html
'
).
onmousemove
=
function
(
event
)
{
var
elementDiv
=
document
.
querySelector
(
'
#extension
'
)
var
xx
=
event
.
pageX
-
10
var
yy
=
event
.
pageY
+
15
elementDiv
.
style
.
top
=
yy
+
'
px
'
elementDiv
.
style
.
left
=
xx
+
'
px
'
}
}
})
myChart
.
on
(
'
mouseout
'
,
function
(
params
)
{
myChart
.
on
(
'
mouseout
'
,
function
(
params
)
{
if
(
params
.
componentType
==
'
yAxis
'
)
{
if
(
params
.
componentType
==
'
yAxis
'
)
{
var
elementDiv
=
document
.
querySelector
(
'
#extension
'
)
var
elementDiv
=
document
.
querySelector
(
'
#extension
'
)
...
@@ -349,6 +372,10 @@ class App extends Component {
...
@@ -349,6 +372,10 @@ class App extends Component {
elementDiv
.
style
.
cssText
=
'
display:none
'
elementDiv
.
style
.
cssText
=
'
display:none
'
}
}
}
}
if
(
params
.
componentType
==
"
markLine
"
){
var
elementDiv
=
document
.
querySelector
(
'
#extension
'
)
elementDiv
.
style
.
cssText
=
'
display:none
'
}
})
})
}
}
})
})
...
...
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