From 9900a0eda5fa6638cbebb9435d55090e74040104 Mon Sep 17 00:00:00 2001 From: "raja.blaze" Date: Mon, 19 Aug 2019 18:50:33 +0530 Subject: [PATCH] overlap issue fixed --- .../home/graph-list/graph-list.component.ts | 36 ++++++++++++------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/app/view/home/graph-list/graph-list.component.ts b/src/app/view/home/graph-list/graph-list.component.ts index 0789447..7941e89 100644 --- a/src/app/view/home/graph-list/graph-list.component.ts +++ b/src/app/view/home/graph-list/graph-list.component.ts @@ -484,8 +484,14 @@ export class GraphListComponent implements OnInit { }]; break; } - // res.response.Minrange, res.response.Maxrange - let range = []; + let range1 = []; + let range2 = []; + let range3 = []; // res.response.Minrange, res.response.Maxrange + if(DifficultychartDate.length == 1 && DifficultyCuckatoo[0] != 0 && DifficultyRandomx[0] != 0 && DifficultyProgpow[0] != 0){ + range1 = [ (DifficultyCuckatoo[0] - (DifficultyCuckatoo[0] * 0.3)), (DifficultyCuckatoo[0] + (DifficultyCuckatoo[0] * 0.3)) ]; + range2 = [ (DifficultyRandomx[0] - (DifficultyRandomx[0] * 0.3)), (DifficultyRandomx[0] + (DifficultyRandomx[0] * 0.3)) ]; + range3 = [ (DifficultyProgpow[0] - (DifficultyProgpow[0] * 0.3)), (DifficultyProgpow[0] + (DifficultyProgpow[0] * 0.3)) ]; + } let tickformat = res.response.tickFormat; // this.lg_last = // TargetDifficulty[TargetDifficulty.length - 1]; @@ -496,7 +502,9 @@ export class GraphListComponent implements OnInit { DifficultychartDate, data, this.Type, - range, + range1, + range2, + range3, tickformat ); break; @@ -505,7 +513,9 @@ export class GraphListComponent implements OnInit { DifficultychartDate, data, this.Type, - range, + range1, + range2, + range3, tickformat ); break; @@ -591,7 +601,7 @@ export class GraphListComponent implements OnInit { }); } - difficultyChartFunc(DifficultychartDate, data, Type, range, tickformat) { + difficultyChartFunc(DifficultychartDate, data, Type, range1, range2, range3, tickformat) { // console.log('range rangerangerange',range); this.linearGraphData = { data: data, @@ -613,15 +623,15 @@ export class GraphListComponent implements OnInit { yaxis: { title: 'Cuckoo', fixedrange: true, - rangemode: 'nonnegative' + rangemode: 'nonnegative', // showgrid: true, - // range: range + range: range1 }, yaxis2: { title: 'Progpow', fixedrange: true, // showgrid: true, - // range: range, + range: range3, overlaying: 'y', rangemode: 'nonnegative', side: 'left', @@ -631,7 +641,7 @@ export class GraphListComponent implements OnInit { title: 'RandomX', fixedrange: true, // showgrid: true, - // range: range, + range: range2, anchor: 'x', overlaying: 'y', rangemode: 'nonnegative', @@ -1270,7 +1280,7 @@ export class GraphListComponent implements OnInit { options: null, }; } - totaldifficultyChartFunc(DifficultychartDate, data, type, range, tickformat) { + totaldifficultyChartFunc(DifficultychartDate, data, type, range1, range2, range3, tickformat) { this.linearTotalGraphData = { data: data, layout: { @@ -1292,13 +1302,13 @@ export class GraphListComponent implements OnInit { fixedrange: true, rangemode: 'nonnegative', // showgrid: true, - // range: range + range: range1, }, yaxis2: { title: 'Progpow', fixedrange: true, // showgrid: true, - // range: range, + range: range3, overlaying: 'y', rangemode: 'nonnegative', side: 'left', @@ -1308,7 +1318,7 @@ export class GraphListComponent implements OnInit { title: 'RandomX', fixedrange: true, // showgrid: true, - // range: range, + range: range2, rangemode: 'nonnegative', anchor: 'x', overlaying: 'y',