up

parent 6bc4f917
import React, { Component } from 'react'; import React, { Component } from 'react';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import dateformat from 'dateformat'
import moment from 'moment' import moment from 'moment'
class App extends Component { class App extends Component {
state={ state={
...@@ -311,20 +312,29 @@ class App extends Component { ...@@ -311,20 +312,29 @@ class App extends Component {
// type:'time', // type:'time',
axisLabel: { axisLabel: {
formatter: (function(value){ formatter: (function(value){
console.log(Math.floor(value/1000000000),'value'); // let statusPassTime = moment(parseInt(value)).format('YYYY-MM-DD');
console.log(value,'value11'); console.log(moment(parseInt(value/1000000)).format('YYYY-MM-DD HH:mm:ss'),'moment')
// return moment(parseInt(value/1000000)).format('YYYY-MM-DD HH:mm:ss')
return moment(parseInt(value/1000000)).format('YYYY-MM-DD HH:mm:ss.SSS')
// console.log(Math.floor(value/1000000000),'ddd')
// console.log(dateformat(Math.floor(value/1000000000), 'yyyy-mm-dd HH:MM:ss'),'sssdddggg')
// console.log(dateformat(value/1000000000, 'yyyy-mm-dd HH:MM:ss'),'dddddddddddd')
// return dateformat(value/1000000000, 'yyyy-mm-dd HH:MM:ss')
// console.log(Math.floor(value/1000000000),'value');
// console.log(value,'value11');
// return Math.floor(value/1000000000) // return Math.floor(value/1000000000)
let label; // let label;
var t = Math.floor(value/1000000000); // // var t = Math.floor(value/1000000000);
// 天 总秒数/一天的秒数=几天 // var t=parseInt(value/1000000000)
var d = parseInt( t / (24*60*60) ); // // 天 总秒数/一天的秒数=几天
// 小时 不够一天的秒数可以换算成几小时 // var d = parseInt( t / (24*60*60) );
var h = parseInt( ( t % (24*60*60) ) / (60*60) ); // // 小时 不够一天的秒数可以换算成几小时
// 分钟 不够一小时的秒数可以换算成几分钟 // var h = parseInt( ( t % (24*60*60) ) / (60*60) );
var m = parseInt( ( t % (60*60) ) / 60 ); // // 分钟 不够一小时的秒数可以换算成几分钟
//秒数 不够一分钟的秒数可以换算成几秒 // var m = parseInt( ( t % (60*60) ) / 60 );
var s = t % 60 ; // //秒数 不够一分钟的秒数可以换算成几秒
return h+':'+m+':'+s // var s = t % 60 ;
// return d+'-'+h+':'+m+':'+s
}) })
}, },
min: data.result.AxisX.AxisXBegin, min: data.result.AxisX.AxisXBegin,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment