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
265bd232
Commit
265bd232
authored
Jul 25, 2022
by
wenli.huang@wuban.net.cn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
newup
parent
2c80d7e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
43 deletions
+75
-43
App.js
src/App.js
+75
-43
No files found.
src/App.js
View file @
265bd232
...
@@ -57,39 +57,37 @@ class App extends Component {
...
@@ -57,39 +57,37 @@ class App extends Component {
allTopAxisXArr
=
TopAxisX
allTopAxisXArr
=
TopAxisX
allBottomAxisXArr
=
BottomAxisX
allBottomAxisXArr
=
BottomAxisX
allLinksArr
=
Links
allLinksArr
=
Links
// console.log(Rows, TopAxisX, BottomAxisX, Links)
that
.
initChart
(
resData
)
that
.
initChart
(
resData
)
if
(
!
that
.
interval
){
if
(
!
that
.
interval
){
that
.
interval
=
setInterval
(()
=>
{
that
.
interval
=
setInterval
(()
=>
{
fetch
(
`/api/graph_by_height_and_duration?height=0&duration=
${
that
.
state
.
requestDuration
}
`
,{
fetch
(
`/api/graph_by_height_and_duration?height=0&duration=
${
that
.
state
.
requestDuration
}
`
,{
method
:
'
GET
'
,
method
:
'
GET
'
,
headers
:{
headers
:{
'
Content-Type
'
:
'
application/json;charset=UTF-8
'
'
Content-Type
'
:
'
application/json;charset=UTF-8
'
},
},
})
})
.
then
(
res
=>
res
.
json
())
.
then
(
res
=>
res
.
json
())
.
then
((
newData
)
=>
{
.
then
((
newData
)
=>
{
let
{
Rows
,
AxisX
,
Links
}
=
newData
.
result
let
{
Rows
,
AxisX
,
Links
}
=
newData
.
result
let
{
TopAxisX
,
BottomAxisX
}
=
AxisX
let
{
TopAxisX
,
BottomAxisX
}
=
AxisX
allRows0Arr
=
Rows
[
0
]
allRows0Arr
=
Rows
[
0
]
allRows1Arr
=
Rows
[
1
]
allRows1Arr
=
Rows
[
1
]
allRows2Arr
=
Rows
[
2
]
allRows2Arr
=
Rows
[
2
]
allTopAxisXArr
=
TopAxisX
allTopAxisXArr
=
TopAxisX
allBottomAxisXArr
=
BottomAxisX
allBottomAxisXArr
=
BottomAxisX
allLinksArr
=
Links
allLinksArr
=
Links
newData
.
result
.
Rows
[
0
]
=
allRows0Arr
newData
.
result
.
Rows
[
0
]
=
allRows0Arr
newData
.
result
.
Rows
[
1
]
=
allRows1Arr
newData
.
result
.
Rows
[
1
]
=
allRows1Arr
newData
.
result
.
Rows
[
2
]
=
allRows2Arr
newData
.
result
.
Rows
[
2
]
=
allRows2Arr
newData
.
result
.
AxisX
.
TopAxisX
=
allTopAxisXArr
newData
.
result
.
AxisX
.
TopAxisX
=
allTopAxisXArr
newData
.
result
.
AxisX
.
BottomAxisX
=
allBottomAxisXArr
newData
.
result
.
AxisX
.
BottomAxisX
=
allBottomAxisXArr
newData
.
result
.
Links
=
allLinksArr
newData
.
result
.
Links
=
allLinksArr
that
.
initChart
(
newData
)
that
.
initChart
(
newData
)
})
})
},
5000
);
},
5000
);
}
}
var
chartDom
=
document
.
getElementById
(
'
main
'
);
var
chartDom
=
document
.
getElementById
(
'
main
'
);
var
myChart
=
echarts
.
init
(
chartDom
);
var
myChart
=
echarts
.
init
(
chartDom
);
...
@@ -98,6 +96,7 @@ class App extends Component {
...
@@ -98,6 +96,7 @@ class App extends Component {
var
options
=
myChart
.
getOption
();
var
options
=
myChart
.
getOption
();
var
endValue
=
options
.
dataZoom
[
0
].
endValue
;
var
endValue
=
options
.
dataZoom
[
0
].
endValue
;
var
startValue
=
options
.
dataZoom
[
0
].
startValue
;
var
startValue
=
options
.
dataZoom
[
0
].
startValue
;
// console.log(options,'option')
// console.log('当前开始时间:',moment(startValue/1000000).format('YYYY-MM-DD HH:mm:ss:sss'))
// console.log('当前开始时间:',moment(startValue/1000000).format('YYYY-MM-DD HH:mm:ss:sss'))
// console.log('当前结束时间:',moment(endValue/1000000).format('YYYY-MM-DD HH:mm:ss:sss'))
// console.log('当前结束时间:',moment(endValue/1000000).format('YYYY-MM-DD HH:mm:ss:sss'))
// var min1
// var min1
...
@@ -247,6 +246,51 @@ class App extends Component {
...
@@ -247,6 +246,51 @@ class App extends Component {
})
})
})
})
}
}
let
flag
=
false
options
.
series
.
map
(
item
=>
{
item
.
data
.
map
(
item1
=>
{
if
(
startValue
<=
item1
.
value
[
0
]
&&
endValue
>=
item1
.
value
[
0
]){
if
(
item1
.
value
[
7
]
===
'
Witness
'
){
flag
=
true
}
}
})
})
if
(
flag
===
true
){
that
.
interval
=
setInterval
(()
=>
{
fetch
(
`/api/graph_by_height_and_duration?height=0&duration=
${
that
.
state
.
requestDuration
}
`
,{
method
:
'
GET
'
,
headers
:{
'
Content-Type
'
:
'
application/json;charset=UTF-8
'
},
})
.
then
(
res
=>
res
.
json
())
.
then
((
newData
)
=>
{
let
{
Rows
,
AxisX
,
Links
}
=
newData
.
result
let
{
TopAxisX
,
BottomAxisX
}
=
AxisX
allRows0Arr
=
Rows
[
0
]
allRows1Arr
=
Rows
[
1
]
allRows2Arr
=
Rows
[
2
]
allTopAxisXArr
=
TopAxisX
allBottomAxisXArr
=
BottomAxisX
allLinksArr
=
Links
newData
.
result
.
Rows
[
0
]
=
allRows0Arr
newData
.
result
.
Rows
[
1
]
=
allRows1Arr
newData
.
result
.
Rows
[
2
]
=
allRows2Arr
newData
.
result
.
AxisX
.
TopAxisX
=
allTopAxisXArr
newData
.
result
.
AxisX
.
BottomAxisX
=
allBottomAxisXArr
newData
.
result
.
Links
=
allLinksArr
that
.
initChart
(
newData
)
})
},
5000
);
}
else
{
clearInterval
(
that
.
interval
)
}
})
})
})
})
})
})
...
@@ -523,18 +567,6 @@ class App extends Component {
...
@@ -523,18 +567,6 @@ class App extends Component {
series
:
series
,
series
:
series
,
};
};
// option.series.map(item=>{
// item.data.map(item1=>{
// if(option.dataZoom[0].startValue <= item1.value[0] && option.dataZoom[0].endValue >= item1.value[0]){
// if(item1.value[7] === 'Witness'){
// console.log("重新开始定时器")
// }
// }
// })
// })
// console.log(option.dataZoom[0].startValue,'11')//1658299327000000000
// console.log(option.dataZoom[0].startValue,'11')//1658299327000000000
// console.log(option.dataZoom[0].endValue,'22')//1658299337000000000
// console.log(option.dataZoom[0].endValue,'22')//1658299337000000000
// console.log(option.series,'option')
// console.log(option.series,'option')
...
...
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