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
aab6735e
Commit
aab6735e
authored
Jul 04, 2022
by
wenli.huang@wuban.net.cn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
29b03a8a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
3 deletions
+34
-3
App.js
src/App.js
+34
-3
No files found.
src/App.js
View file @
aab6735e
...
@@ -99,13 +99,11 @@ class App extends Component {
...
@@ -99,13 +99,11 @@ class App extends Component {
var
chartDom
=
document
.
getElementById
(
'
main
'
);
var
chartDom
=
document
.
getElementById
(
'
main
'
);
var
myChart
=
echarts
.
init
(
chartDom
);
var
myChart
=
echarts
.
init
(
chartDom
);
var
option
;
var
option
;
const
series
=
[];
const
series
=
[];
this
.
state
.
AxisY
.
forEach
(
function
(
type
)
{
this
.
state
.
AxisY
.
forEach
(
function
(
type
)
{
const
arr
=
target
.
map
(
function
(
item
)
{
const
arr
=
target
.
map
(
function
(
item
)
{
const
data
=
item
.
map
((
item
,
index
)
=>
{
const
data
=
item
.
map
((
item
,
index
)
=>
{
// console.log(item,'item')
var
colors
var
colors
if
(
item
[
7
]
===
'
Normal
'
){
if
(
item
[
7
]
===
'
Normal
'
){
colors
=
'
#4B4B4B
'
colors
=
'
#4B4B4B
'
...
@@ -195,7 +193,6 @@ class App extends Component {
...
@@ -195,7 +193,6 @@ class App extends Component {
containLabel
:
true
,
containLabel
:
true
,
top
:
80
top
:
80
},
},
xAxis
:
[
xAxis
:
[
{
{
// type: 'value',
// type: 'value',
...
@@ -314,11 +311,45 @@ class App extends Component {
...
@@ -314,11 +311,45 @@ class App extends Component {
}
}
}
}
})
})
myChart
.
on
(
'
mousemove
'
,
function
(
params
)
{
console
.
log
(
params
)
if
(
params
.
componentType
==
"
series
"
){
if
(
params
.
name
===
params
.
data
.
name
){
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
.
value
[
0
]
/
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
'
)
elementDiv
.
style
.
cssText
=
'
display:none
'
elementDiv
.
style
.
cssText
=
'
display:none
'
}
}
if
(
params
.
componentType
==
"
series
"
){
if
(
params
.
name
===
params
.
data
.
name
){
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