Skip to content

Commit

Permalink
Merge pull request #3203 from aura-nw/baseline/main_20240327
Browse files Browse the repository at this point in the history
update chart
  • Loading branch information
nhphuc2411 authored Mar 27, 2024
2 parents 4296d92 + 44b65dc commit 8f7aa9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class ChartDetailComponent implements OnInit, OnDestroy {
logicalRangeChange$ = new Subject<{ from; to }>();
endData = false;
destroy$ = new Subject<void>();
prevYearNumber = 1;
originalData = [];
isLoading = true;
errTxt: string;
Expand Down Expand Up @@ -159,9 +158,9 @@ export class ChartDetailComponent implements OnInit, OnDestroy {
subscribeVisibleLogicalRangeChange() {
this.logicalRangeChange$.pipe(debounceTime(500), takeUntil(this.destroy$)).subscribe(({ from, to }) => {
if (from <= 0 && !this.endData) {
this.prevYearNumber++;
const currTime = new Date();
const prevTime = new Date(currTime.getFullYear() - this.prevYearNumber, 0, 1);
const prevTime = new Date(Date.now() - 365 * 24 * 60 * 60 * 1000);

this.statisticService.getDataStatistic(prevTime, currTime).subscribe((res) => {
if (res?.daily_statistics.length > 0) {
let dataY = [];
Expand Down Expand Up @@ -218,7 +217,7 @@ export class ChartDetailComponent implements OnInit, OnDestroy {
this.endData = false;
this.chartRange = type;
const currTime = new Date();
const prevTime = new Date(currTime.getFullYear() - 1, 0, 1);
const prevTime = new Date(Date.now() - 365 * 24 * 60 * 60 * 1000);

this.statisticService.getDataStatistic(prevTime, currTime).subscribe({
next: (res) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export class ChartStatsComponent implements OnInit {
minValueDailyAddress = 0;
maxValueDailyTx = 0;
minValueDailyTx = 0;

chainName = this.env.chainName;

constructor(
Expand Down Expand Up @@ -144,7 +143,7 @@ export class ChartStatsComponent implements OnInit {
visible: true,
borderColor: '#494C58',
scaleMargins: {
top: 0.3,
top: 0.55,
bottom: 0.05,
},
mode: 1,
Expand Down

0 comments on commit 8f7aa9b

Please sign in to comment.