Browse Source

Improve layout

pull/6210/head
Thomas Kaul 3 weeks ago
parent
commit
bd5b8a1d00
  1. 11
      apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
  2. 15
      apps/client/src/app/pages/portfolio/analysis/analysis-page.html

11
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts

@ -2,6 +2,7 @@ import { GfBenchmarkComparatorComponent } from '@ghostfolio/client/components/be
import { GfInvestmentChartComponent } from '@ghostfolio/client/components/investment-chart/investment-chart.component'; import { GfInvestmentChartComponent } from '@ghostfolio/client/components/investment-chart/investment-chart.component';
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service';
import { UserService } from '@ghostfolio/client/services/user/user.service'; import { UserService } from '@ghostfolio/client/services/user/user.service';
import { NUMERICAL_PRECISION_THRESHOLD_6_FIGURES } from '@ghostfolio/common/config';
import { import {
HistoricalDataItem, HistoricalDataItem,
InvestmentItem, InvestmentItem,
@ -94,6 +95,7 @@ export class GfAnalysisPageComponent implements OnDestroy, OnInit {
public performanceDataItems: HistoricalDataItem[]; public performanceDataItems: HistoricalDataItem[];
public performanceDataItemsInPercentage: HistoricalDataItem[]; public performanceDataItemsInPercentage: HistoricalDataItem[];
public portfolioEvolutionDataLabel = $localize`Investment`; public portfolioEvolutionDataLabel = $localize`Investment`;
public precision = 2;
public streaks: PortfolioInvestmentsResponse['streaks']; public streaks: PortfolioInvestmentsResponse['streaks'];
public top3: PortfolioPosition[]; public top3: PortfolioPosition[];
public unitCurrentStreak: string; public unitCurrentStreak: string;
@ -317,12 +319,21 @@ export class GfAnalysisPageComponent implements OnDestroy, OnInit {
: valueInPercentage : valueInPercentage
}); });
} }
this.performanceDataItemsInPercentage.push({ this.performanceDataItemsInPercentage.push({
date, date,
value: netPerformanceInPercentageWithCurrencyEffect value: netPerformanceInPercentageWithCurrencyEffect
}); });
} }
if (
this.deviceType === 'mobile' &&
this.performance.currentValueInBaseCurrency >=
NUMERICAL_PRECISION_THRESHOLD_6_FIGURES
) {
this.precision = 0;
}
this.isLoadingInvestmentChart = false; this.isLoadingInvestmentChart = false;
this.updateBenchmarkDataItems(); this.updateBenchmarkDataItems();

15
apps/client/src/app/pages/portfolio/analysis/analysis-page.html

@ -74,8 +74,9 @@
</div> </div>
</div> </div>
} }
<div class="mb-5 row"> <div class="mb-5 row">
<div class="col-md-4 mb-3 mb-md-0"> <div class="col-lg-4 mb-3 mb-lg-0">
<mat-card appearance="outlined"> <mat-card appearance="outlined">
<mat-card-content> <mat-card-content>
<gf-value <gf-value
@ -83,18 +84,19 @@
size="large" size="large"
[isCurrency]="true" [isCurrency]="true"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"
[precision]="precision"
[unit]="user?.settings?.baseCurrency" [unit]="user?.settings?.baseCurrency"
[value]=" [value]="
isLoadingInvestmentChart isLoadingInvestmentChart
? undefined ? undefined
: performance?.currentValueInBaseCurrency : performance?.currentValueInBaseCurrency
" "
>Value</gf-value >Total amount</gf-value
> >
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
</div> </div>
<div class="col-md-4 mb-3 mb-md-0"> <div class="col-lg-4 mb-3 mb-lg-0">
<mat-card appearance="outlined"> <mat-card appearance="outlined">
<mat-card-content> <mat-card-content>
<gf-value <gf-value
@ -103,18 +105,19 @@
[colorizeSign]="true" [colorizeSign]="true"
[isCurrency]="true" [isCurrency]="true"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"
[precision]="precision"
[unit]="user?.settings?.baseCurrency" [unit]="user?.settings?.baseCurrency"
[value]=" [value]="
isLoadingInvestmentChart isLoadingInvestmentChart
? undefined ? undefined
: performance?.netPerformanceWithCurrencyEffect : performance?.netPerformanceWithCurrencyEffect
" "
>Change with Currency Effect</gf-value >Change with currency effect</gf-value
> >
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
</div> </div>
<div class="col-md-4"> <div class="col-lg-4">
<mat-card appearance="outlined"> <mat-card appearance="outlined">
<mat-card-content> <mat-card-content>
<gf-value <gf-value
@ -128,7 +131,7 @@
? undefined ? undefined
: performance?.netPerformancePercentageWithCurrencyEffect : performance?.netPerformancePercentageWithCurrencyEffect
" "
>Performance with Currency Effect</gf-value >Performance with currency effect</gf-value
> >
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>

Loading…
Cancel
Save