Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
</div>
</ng-template>
</igx-column>
<igx-column field="value.currentPrice" header="Last Price" [dataType]="'currency'" [width]="'7%'" [minWidth]="'80px'"></igx-column>
<igx-column field="value.currentPrice" header="Last Price" [dataType]="'currency'" [width]="'7%'" [minWidth]="'80px'" [pipeArgs]="currencyDigitsFormat"></igx-column>
<igx-column field="dailyPercentageChange" header="Change %" dataType="percent" [cellClasses]="profitLossValueClasses" [width]="'10%'" [minWidth]="'85px'">
<ng-template igxCell let-val>
<div class="assets-container">
<div>
{{ val | percent : "1.0-2" }}
{{ val | percent : "1.2-2" }}
</div>

@if (val >= 0) {
Expand All @@ -35,12 +35,12 @@
</div>
</ng-template>
</igx-column>
<igx-column field="marketValue" header="Market Value" [dataType]="'currency'" [width]="'5%'" [minWidth]="'100px'"></igx-column>
<igx-column field="profitLossValue" header="NET Profit" dataType="currency" [width]="'10%'" [minWidth]="'90px'" [cellClasses]="profitLossValueClasses">
<igx-column field="marketValue" header="Market Value" [dataType]="'currency'" [width]="'5%'" [minWidth]="'100px'" [pipeArgs]="currencyDigitsFormat"></igx-column>
<igx-column field="profitLossValue" header="NET Profit" [dataType]="'currency'" [width]="'10%'" [minWidth]="'90px'" [cellClasses]="profitLossValueClasses">
<ng-template igxCell let-val>
<div class="assets-container">
<div>
{{ val | currency }}
{{ val | currency : 'USD' : 'symbol' : '1.2-2' }}
</div>

@if (val >= 0) {
Expand All @@ -55,7 +55,7 @@
<ng-template igxCell let-val>
<div class="assets-container">
<div>
{{ val | percent : "1.0-2" }}
{{ val | percent : "1.2-2" }}
</div>

@if (val >= 0) {
Expand All @@ -70,15 +70,15 @@
<ng-template igxCell let-val>
<div class="progress-container">
<div style="width: 42px;">
{{ val | percent : "1.0-2" }}
{{ val | percent : "1.2-2" }}
</div>
<igx-linear-bar [value]="val * 100" [animate]="false" textVisibility="false"></igx-linear-bar>
</div>
</ng-template>
</igx-column>
<igx-column field="value.boughtPrice" header="Average Cost" dataType="currency" [width]="'10%'" [minWidth]="'100px'"></igx-column>
<igx-column field="value.boughtPrice" header="Average Cost" dataType="currency" [width]="'10%'" [minWidth]="'100px'" [pipeArgs]="currencyDigitsFormat"></igx-column>
<igx-column field="positions" header="Position" [dataType]="'number'" [width]="'6%'" [minWidth]="'80px'"></igx-column>
<igx-column field="holdingPeriod" header="Holding Period" [width]="'8%'" [minWidth]="'50px'">
<igx-column field="holdingPeriod" header="Holding Period" [minWidth]="'50px'">
<ng-template igxCell let-val> {{ val }} days </ng-template>
</igx-column>
</igx-grid>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
OnInit,
ViewChild
} from '@angular/core';
import { FilteringExpressionsTree, FilteringLogic, IgxStringFilteringOperand, THEME_TOKEN, ThemeToken } from 'igniteui-angular/core';
import { FilteringExpressionsTree, FilteringLogic, IColumnPipeArgs, IgxStringFilteringOperand, THEME_TOKEN, ThemeToken } from 'igniteui-angular/core';
import { IgxAvatarComponent } from 'igniteui-angular/avatar';
import { IgxCellTemplateDirective, IgxColumnComponent, IgxGridToolbarActionsComponent, IgxGridToolbarComponent, IgxGridToolbarExporterComponent, IgxGridToolbarHidingComponent, IgxGridToolbarPinningComponent, IgxGridToolbarTitleComponent } from 'igniteui-angular/grids/core';
import { IgxGridComponent } from 'igniteui-angular/grids/grid';
Expand Down Expand Up @@ -47,15 +47,18 @@ import { FormsModule } from '@angular/forms';
IgxGridToolbarActionsComponent,
IgxGridToolbarHidingComponent,
IgxGridToolbarPinningComponent,
IgxGridToolbarExporterComponent,
],
IgxGridToolbarExporterComponent
],
templateUrl: './finance-grid.component.html',
styleUrl: './finance-grid.component.scss',
})
export class FinanceGridComponent implements OnInit, OnDestroy {
@ViewChild(IgxGridComponent, { static: true }) public grid!: IgxGridComponent;
public data$: BehaviorSubject<any> = new BehaviorSubject([]);
public isLoading = true;
public currencyDigitsFormat: IColumnPipeArgs = {
digitsInfo: '1.2-2'
};

public profitLossValueClasses = {
profitCondition: this.profitConditionHandler,
Expand Down
Loading