Changes updated

This commit is contained in:
root 2019-08-22 18:31:01 +05:30
parent ee2506ceab
commit c5d643212e
2 changed files with 6 additions and 4 deletions

View File

@ -1224,7 +1224,7 @@ export class BlockchainBlockController {
} }
const BlockQuery = await getConnection(Global.network) const BlockQuery = await getConnection(Global.network)
.query( .query(
"SELECT bb.height, coalesce(max(bb.alter), 0) as alter, bb.timestamp FROM (SELECT height, EXTRACT(EPOCH FROM (timestamp - LAG(timestamp) OVER (ORDER BY timestamp))) AS alter, timestamp FROM blockchain_block where timestamp::date = date '"+IntervalDate+"' order by height asc) as bb group by bb.height , bb.timestamp;", "SELECT bb.height, coalesce(max(bb.alter), 0) as alter, bb.timestamp FROM (SELECT height, EXTRACT(EPOCH FROM (timestamp - LAG(timestamp) OVER (ORDER BY timestamp))) AS alter, timestamp FROM blockchain_block where timestamp::date = date '"+IntervalDate+"' AND height != 0 order by height asc) as bb group by bb.height , bb.timestamp;",
) )
.catch(err_msg => { .catch(err_msg => {
next(err_msg); next(err_msg);
@ -1944,7 +1944,7 @@ let remaining_height = 0;
"select date(DATE_TRUNC('day', timestamp)) as date, count(hash) as blocks, 86400/count(hash) as period \ "select date(DATE_TRUNC('day', timestamp)) as date, count(hash) as blocks, 86400/count(hash) as period \
from blockchain_block where " + from blockchain_block where " +
timeIntervalQry + timeIntervalQry +
"group by DATE_TRUNC('day', timestamp) order by date", "AND height != 0 group by DATE_TRUNC('day', timestamp) order by date",
) )
.catch(err_msg => { .catch(err_msg => {
next(err_msg); next(err_msg);

View File

@ -567,7 +567,8 @@ export class GraphListComponent implements OnInit {
let BlocksChartHeight = res.response.Blocks; let BlocksChartHeight = res.response.Blocks;
let Blockval = res.response.alter; let Blockval = res.response.alter;
this.blockinteval_last = Blockval[Blockval.length - 1]; this.blockinteval_last = Blockval[Blockval.length - 1];
this.BlocksIntevalFunc(BlocksChartHeight, Blockval); var range = [ BlocksChartHeight[0], BlocksChartHeight[BlocksChartHeight.length-1] ];
this.BlocksIntevalFunc(BlocksChartHeight, Blockval, range);
resolve(); resolve();
} }
}, },
@ -791,7 +792,7 @@ export class GraphListComponent implements OnInit {
}; };
} }
BlocksIntevalFunc(BlocksChartHeight, Blockval) { BlocksIntevalFunc(BlocksChartHeight, Blockval, range) {
this.barGraphIntevalData = { this.barGraphIntevalData = {
data: [ data: [
{ {
@ -820,6 +821,7 @@ export class GraphListComponent implements OnInit {
showlegend: false, showlegend: false,
xaxis: { xaxis: {
tickangle: -45, tickangle: -45,
range: range,
showgrid: true, showgrid: true,
title: 'Block Height', title: 'Block Height',
rangemode: 'nonnegative', rangemode: 'nonnegative',