Kind: Class
Source: Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/widget-top-offers-by-principals-last-nyears/widget-top-offers-by-principals-last-nyears.component.ts (line 23)
Part of: Pams
WidgetTopOffersByPrincipalsLastNyearsComponent manages dashboard data for the top offers by principals view across recent years. It coordinates data retrieval, response handling, chart setup and interactions, year color selection, caching, and value-change updates.
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 |
switchChartRefernceCommissionHandler | switchChartRefernceCommissionHandler() | void |
toggoleOnlyCurrentOffers | toggoleOnlyCurrentOffers() | 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 |
_FirmOffers | boolean |
_BudgetOffers | boolean |
numYearsDatasource | any[] |
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 AngularLifecycle[Angular lifecycle] --> ngOnInit AngularLifecycle --> ngOnChanges ngOnInit --> getDashboardData ngOnChanges --> getDashboardData getDashboardData --> afterResponse afterResponse --> setYearColor afterResponse --> onChartInit onChartInit --> Chart[Offers chart] Chart --> onPlannedVisitsChartClick ValueChange[Value change] --> onValueChanged onValueChanged --> setChaching getChaching --> getDashboardData
Usage
tsimport { WidgetTopOffersByPrincipalsLastNyearsComponent } from './widget-top-offers-by-principals-last-nyears.component';
export function refreshTopOffers(
widget: WidgetTopOffersByPrincipalsLastNyearsComponent
): void {
widget.getChaching();
widget.getDashboardData();
}
export function persistSelectedValue(
widget: WidgetTopOffersByPrincipalsLastNyearsComponent
): void {
widget.onValueChanged();
widget.setChaching();
}
AI Coding Instructions
- Use
getDashboardData()as the entry point when the widget needs refreshed dashboard content. - Keep response-specific chart preparation in
afterResponse()and initialize chart bindings throughonChartInit(). - Let Angular invoke
ngOnInit()andngOnChanges()rather than calling lifecycle hooks from application code. - Preserve the existing
setChaching()andgetChaching()method names when changing cache behavior. - Keep chart click behavior inside
onPlannedVisitsChartClick()so chart event handling remains localized.
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?