target difficulty graph and color and default select seeting s in tranaction over time

This commit is contained in:
shunmugam 2019-09-13 18:34:32 +05:30
parent 1f1a550e9c
commit bb688019af
2 changed files with 53 additions and 22 deletions

View File

@ -22,7 +22,7 @@ export class GraphDetailComponent implements OnInit {
public title: any; public title: any;
public chartType : any = []; public chartType : any = [];
public selectedItem: Number = 3; public selectedItem: Number = 3;
public selectedItem8: Number = 2; public selectedItem8: Number = 1;
public selectedItem12: Number = 4; public selectedItem12: Number = 4;
public Type: any = ''; public Type: any = '';
public selectedTarget: Number = 3; public selectedTarget: Number = 3;
@ -77,12 +77,12 @@ export class GraphDetailComponent implements OnInit {
// this.totalDifficultyreq(); // this.totalDifficultyreq();
this.comp.Difficultyreq('target').then(res => { this.comp.Difficultyreq('target').then(res => {
this.hashdata = this.comp.linearGraphData; this.hashdata = this.comp.linearGraphData;
console.log('this.comp.linearGraphData',this.comp.linearGraphData); // console.log('this.comp.linearGraphData',this.comp.linearGraphData);
this.hashdata.layout.height = 300; // this.hashdata.layout.height = 300;
this.hashdata.layout.xaxis.domain = [0.1,0.9]; // this.hashdata.layout.xaxis.domain = [0.1,0.9];
this.hashdata.layout.yaxis2.position = 2.25; // this.hashdata.layout.yaxis2.position = 2.25;
this.title = 'Target Difficulty'; this.title = 'Target Difficulty';
this.selectedItem = 6; // this.selectedItem = 6;
this.titleService.setTitle( this.titleService.setTitle(
this.route.snapshot.data.title + ' - ' + this.title, this.route.snapshot.data.title + ' - ' + this.title,
); );
@ -251,11 +251,11 @@ export class GraphDetailComponent implements OnInit {
this.comp.Difficultyreq('total',p1, p2, p3, p4).then(res => { this.comp.Difficultyreq('total',p1, p2, p3, p4).then(res => {
this.hashdata = this.comp.linearTotalGraphData; this.hashdata = this.comp.linearTotalGraphData;
// this.hashdata.layout.height = 300; // this.hashdata.layout.height = 300;
// this.hashdata.layout.xaxis.domain = [0.1,0.9]; // this.hashdata.layout.xaxis.domain = [0.9, 0.9];
// this.hashdata.layout.yaxis.automargin= true; // this.hashdata.layout.yaxis.automargin= true;
// this.hashdata.layout.yaxis1.automargin= true; // this.hashdata.layout.yaxis1.automargin= true;
// this.hashdata.layout.yaxis2.automargin= true; // this.hashdata.layout.yaxis2.automargin= true;
// this.hashdata.layout.yaxis2.position = 2.25; // this.hashdata.layout.yaxis2.position = 0.0;
this.title = 'Total Difficulty'; this.title = 'Total Difficulty';
}); });
break; break;

View File

@ -51,7 +51,7 @@ export class GraphListComponent implements OnInit {
public selectedItem5: Number = 3; public selectedItem5: Number = 3;
public selectedItem7: Number = 3; public selectedItem7: Number = 3;
public selectedItem8: Number = 3; public selectedItem8: Number = 3;
public selectedItem81: Number = 2; public selectedItem81: Number = 1;
public selectedItem9: Number = 3; public selectedItem9: Number = 3;
public selectedItem10: Number = 3; public selectedItem10: Number = 3;
public selectedItem11: Number = 3; public selectedItem11: Number = 3;
@ -608,6 +608,21 @@ export class GraphListComponent implements OnInit {
} }
difficultyChartFunc(DifficultychartDate, data, Type, range1, range2, range3, tickformat) { difficultyChartFunc(DifficultychartDate, data, Type, range1, range2, range3, tickformat) {
let window_width = window.screen.width;
let position = 0.00;
let angle = 0;
if(window_width > 700)
{
position = 0.10;
angle = 0;
}
else
{
position = 0.00;
angle = -45;
}
// console.log('range rangerangerange',range); // console.log('range rangerangerange',range);
this.linearGraphData = { this.linearGraphData = {
data: data, data: data,
@ -623,15 +638,22 @@ export class GraphListComponent implements OnInit {
tickformat: tickformat, tickformat: tickformat,
fixedrange: true, fixedrange: true,
rangemode: 'nonnegative', rangemode: 'nonnegative',
domain: [0.2, 0.8] domain: [0.26, 0.9],
// showgrid: true // showgrid: true
tickfont: {
size: 12
}
}, },
yaxis: { yaxis: {
title: 'Cuckoo', title: 'Cuckoo',
fixedrange: true, fixedrange: true,
rangemode: 'nonnegative', rangemode: 'nonnegative',
// showgrid: true, // showgrid: true,
range: range1 range: range1,
tickangle: angle,
tickfont: {
size: 12
}
}, },
yaxis2: { yaxis2: {
title: 'Progpow', title: 'Progpow',
@ -640,8 +662,12 @@ export class GraphListComponent implements OnInit {
range: range3, range: range3,
overlaying: 'y', overlaying: 'y',
rangemode: 'nonnegative', rangemode: 'nonnegative',
side: 'left', // side: 'left',
position: 1.25 position: position,
tickangle: angle,
tickfont: {
size: 12
}
}, },
yaxis3: { yaxis3: {
title: 'RandomX', title: 'RandomX',
@ -651,7 +677,12 @@ export class GraphListComponent implements OnInit {
anchor: 'x', anchor: 'x',
overlaying: 'y', overlaying: 'y',
rangemode: 'nonnegative', rangemode: 'nonnegative',
side: 'right' side: 'right',
position: 0.00 ,
tickangle: angle,
tickfont: {
size: 12
}
}, },
margin: { margin: {
@ -1141,11 +1172,11 @@ export class GraphListComponent implements OnInit {
[0.2222222222222222, "rgb(44,187,232)"], [0.2222222222222222, "rgb(44,187,232)"],
[0.3333333333333333, "rgb(97,211,254)"], [0.3333333333333333, "rgb(97,211,254)"],
[0.4444444444444444, "rgb(72,220,107)"], [0.4444444444444444, "rgb(72,220,107)"],
[0.5555555555555556, "rgb(255,72,102)"], [0.5555555555555556, "rgb(255,209,0)"],
[0.6666666666666666, "rgb(254,85,51)"], [0.6666666666666666, "rgb(255,166,0)"],
[0.7777777777777778, "rgb(255,166,0)"], [0.7777777777777778, "rgb(255,72,102)"],
[0.8888888888888888, "rgb(255,209,0)"], [0.8888888888888888, "rgb(254,85,51)"],
[1.0, "rgb(255,209,0)"]], [1.0, "rgb(254,85,51)"]],
//colors : colorRamp(c("red", "green")), //colors : colorRamp(c("red", "green")),
type: 'heatmap', type: 'heatmap',
visible: true, visible: true,
@ -1319,8 +1350,8 @@ export class GraphListComponent implements OnInit {
} }
totaldifficultyChartFunc(DifficultychartDate, data, type, range1, range2, range3, tickformat) { totaldifficultyChartFunc(DifficultychartDate, data, type, range1, range2, range3, tickformat) {
let window_width = window.screen.width; let window_width = window.screen.width;
let position; let position = 0.00;
let angle; let angle = 0;
if(window_width > 700) if(window_width > 700)
{ {
position = 0.10; position = 0.10;