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
d28b3ca0
Commit
d28b3ca0
authored
Jul 05, 2022
by
wenli.huang@wuban.net.cn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
up
parent
725537e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
7 deletions
+34
-7
App.js
src/App.js
+34
-7
No files found.
src/App.js
View file @
d28b3ca0
...
...
@@ -13,7 +13,7 @@ class App extends Component {
duration
:
-
10
}
componentDidMount
(){
fetch
(
`/api/graph_by_height_and_duration?height=
100&duration=
${
this
.
state
.
duration
}
`
,{
fetch
(
`/api/graph_by_height_and_duration?height=
0&duration=-10
`
,{
method
:
'
GET
'
,
headers
:{
'
Content-Type
'
:
'
application/json;charset=UTF-8
'
...
...
@@ -35,6 +35,7 @@ class App extends Component {
var
timeee
=
moment
(
data
.
result
.
AxisX
.
BlockTime
/
1000000
)
timeee
.
format
(
'
YYYY-MM-DD HH:mm:ss
'
)
timeee
.
add
(
this
.
state
.
duration
,
'
seconds
'
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
)
timeee
.
unix
()
...
...
@@ -88,12 +89,13 @@ class App extends Component {
if
(
this
.
state
.
duration
<
0
){
timeee
=
moment
(
data
.
result
.
AxisX
.
BlockTime
/
1000000
)
mintime
=
moment
(
data
.
result
.
AxisX
.
BlockTime
/
1000000
)
// mintime.add(-(this.state.duration),'seconds').format('YYYY-MM-DD HH:mm:ss')
mintime
.
subtract
(
-
(
this
.
state
.
duration
),
'
seconds
'
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
)
moment
(
data
.
result
.
AxisX
.
BlockTime
/
1000000
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
)
}
console
.
log
(
this
.
state
.
duration
,
'
dddddd
'
)
console
.
log
(
-
(
this
.
state
.
duration
),
'
ppppppp
'
)
//
console.log(this.state.duration,'dddddd')
//
console.log(-(this.state.duration),'ppppppp')
var
source
=
data
.
result
.
Rows
var
target
=
[];
for
(
var
i
in
source
){
...
...
@@ -210,6 +212,7 @@ class App extends Component {
top
:
80
},
xAxis
:
[
{
name
:
'
Time
'
,
axisLabel
:
{
...
...
@@ -218,7 +221,9 @@ class App extends Component {
return
moment
(
parseInt
(
value
/
1000000
)).
format
(
'
YYYY-MM-DD HH:mm:ss
'
)
})
},
max
:
timeee
.
unix
()
*
1000000000
,
// max:timeee.add(10,'seconds').unix()*1000000000,
min
:
mintime
.
unix
()
*
1000000000
,
splitNumber
:
10
,
...
...
@@ -230,7 +235,7 @@ class App extends Component {
axisTick
:
{
alignWithLabel
:
true
,
},
// scrollBar: true
},
// 上边的轴指的是之前block
...
...
@@ -247,7 +252,8 @@ class App extends Component {
},
axisTick
:
{
alignWithLabel
:
true
,
}
},
// scrollBar: true
},
{
axisLine
:{
...
...
@@ -259,7 +265,8 @@ class App extends Component {
},
axisTick
:
{
alignWithLabel
:
true
,
}
},
// scrollBar: true
},
],
yAxis
:
{
...
...
@@ -290,6 +297,26 @@ class App extends Component {
}
},
// dataZoom: [
// {
// // height:20,
// type: "slider",
// show: true,
// xAxisIndex: [0],
// left: '5%',
// bottom:-1,
// start: 0,
// end: 80
// },
// {
// type: "inside", // 支持内部鼠标滚动平移
// start: 0,
// end: 5,
// zoomOnMouseWheel: false, // 关闭滚轮缩放
// moveOnMouseWheel: true, // 开启滚轮平移
// moveOnMouseMove: true // 鼠标移动能触发数据窗口平移
// }
// ],
toolbox
:
{
feature
:
{
dataZoom
:
{}
...
...
@@ -300,7 +327,7 @@ class App extends Component {
// },
series
:
series
,
};
console
.
log
(
option
,
'
opitons
'
)
//
console.log(option,'opitons')
myChart
.
setOption
(
option
);
// window.addEventListener("resize", function () {
// myChart.resize(); //使图表自适应窗口的大小
...
...
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