Kind: Class
Source: Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/widget-top-offers-by-clients-last-nyears/widget-top-offers-by-clients-last-nyears.component.ts (line 22)
Part of: Pams
WidgetTopOffersByClientsLastNyearsComponent is an Angular dashboard widget that retrieves and presents top offers grouped by client over a recent-year range. It manages widget lifecycle events, chart initialization and click handling, year-based coloring, value changes, and cached widget state.
Implements: OnInit
Methods
| Method | Signature | Returns |
|---|---|---|
getDashboardData | getDashboardData() | void |
afterResponse | afterResponse(Data: any[]) | void |
ngOnChanges | ngOnChanges() | void |
ngOnInit | ngOnInit() | void |
setYearColor | setYearColor(year: number) | string |
onChartInit | onChartInit(e: any) | void |
onPlannedVisitsChartClick | onPlannedVisitsChartClick(e: undefined) | void |
setChaching | setChaching() | void |
getChaching | getChaching() | void |
onValueChanged | onValueChanged(e: undefined) | void |
switchChartTypeHandler | switchChartTypeHandler() | void |
toggoleOnlyCurrentOffers | toggoleOnlyCurrentOffers() | void |
switchChartRefernceCommissionHandler | switchChartRefernceCommissionHandler() | void |
toggoleBudgetOffers | toggoleBudgetOffers() | void |
toggoleFirmOffers | toggoleFirmOffers() | void |
switchFirmOffers | switchFirmOffers() | void |
switchBudgetOffers | switchBudgetOffers() | void |
nextPage | nextPage() | void |
prevPage | prevPage() | void |
ngOnDestroy | ngOnDestroy() | void |
Properties
| Property | Type |
|---|---|
_widget | Widget |
meAsVendor | boolean |
isRefernceCommission | boolean |
withoutOptionBar | boolean |
onlyCurrentOffers | boolean |
numYears | number |
numYearsDatasource | any[] |
_FirmOffers | boolean |
_BudgetOffers | boolean |
todayWidgetsEnum | any |
subscription | Subscription |
branchName | string |
maxValueForYaxis | number |
initOpts | any |
series | any[] |
headerData | any[] |
echartsIntance | any |
cachingWidgetData | CachingWidgetData |
originalDatasource | WidgetTopOffers[] |
datasource | WidgetTopOffers[] |
originalHeader | any[] |
options | any |
skip | number |
Diagram
mermaidgraph LR Dashboard[Dashboard inputs] --> Changes[ngOnChanges] Init[ngOnInit] --> Data[getDashboardData] Changes --> Data Value[onValueChanged] --> Data Data --> Response[afterResponse] Response --> Chart[onChartInit] Chart --> Click[onPlannedVisitsChartClick] Response --> Colors[setYearColor] CacheGet[getChaching] --> Data Data --> CacheSet[setChaching]
Usage
tsimport { Component, ViewChild } from '@angular/core';
import { WidgetTopOffersByClientsLastNyearsComponent } from './widget-top-offers-by-clients-last-nyears.component';
@Component({
selector: 'app-dashboard-page',
template: `
<app-widget-top-offers-by-clients-last-nyears
#topOffersWidget>
</app-widget-top-offers-by-clients-last-nyears>
`
})
export class DashboardPageComponent {
@ViewChild('topOffersWidget')
topOffersWidget?: WidgetTopOffersByClientsLastNyearsComponent;
refreshTopOffers(): void {
this.topOffersWidget?.getDashboardData();
}
}
AI Coding Instructions
- Let Angular invoke
ngOnInitandngOnChanges; do not call lifecycle hooks directly from application code. - Keep data loading in
getDashboardData()and process returned data throughafterResponse(). - Preserve the existing
setChaching()andgetChaching()method names when working with cached widget state. - Initialize chart event wiring in
onChartInit()and keep chart click behavior inonPlannedVisitsChartClick(). - When adding filter inputs or dashboard controls, route updates through
onValueChanged()so the widget reloads consistently.
Used by
2 references from 2 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.
Imported by (2)
TranslateHandler—Pams/Web/Pams.Web/Client/app/app.module.ts:1WidgetTopOffersByVariantsComponent—Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/widget-top-offers-by-variants/widget-top-offers-by-variants.component.ts:1
Was this page helpful?