Removing AVG() from mysql query reducing execution time. Increasing graph data span.

fixes #106
This commit is contained in:
softsimon
2020-10-26 01:00:21 +07:00
parent c5c2d67fce
commit 9d7b52a104
4 changed files with 63 additions and 54 deletions

View File

@@ -30,9 +30,13 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
ngOnInit(): void {
const showLegend = !this.isMobile && this.showLegend;
let labelHops = !this.showLegend ? 12 : 6;
let labelHops = !this.showLegend ? 48 : 24;
if (this.small) {
labelHops = labelHops * 2;
labelHops = labelHops / 2;
}
if (this.isMobile) {
labelHops = 96;
}
const labelInterpolationFnc = (value: any, index: any) => {
@@ -65,7 +69,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
},
axisY: {
labelInterpolationFnc: (value: number): any => this.vbytesPipe.transform(value, 2),
offset: showLegend ? 160 : 80,
offset: showLegend ? 160 : 60,
},
plugins: [
Chartist.plugins.ctTargetLine({

View File

@@ -53,7 +53,11 @@ export class StatisticsComponent implements OnInit {
this.seoService.setTitle('Graphs');
this.stateService.networkChanged$.subscribe((network) => this.network = network);
const isMobile = window.innerWidth <= 767.98;
const labelHops = isMobile ? 12 : 6;
let labelHops = isMobile ? 48 : 24;
if (isMobile) {
labelHops = 96;
}
const labelInterpolationFnc = (value: any, index: any) => {
switch (this.radioGroupForm.controls.dateSpan.value) {