Skip to content

WidgetTopOffersByClientsLastNyearsComponent

reference
2 min readUpdated

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

MethodSignatureReturns
getDashboardDatagetDashboardData()void
afterResponseafterResponse(Data: any[])void
ngOnChangesngOnChanges()void
ngOnInitngOnInit()void
setYearColorsetYearColor(year: number)string
onChartInitonChartInit(e: any)void
onPlannedVisitsChartClickonPlannedVisitsChartClick(e: undefined)void
setChachingsetChaching()void
getChachinggetChaching()void
onValueChangedonValueChanged(e: undefined)void
switchChartTypeHandlerswitchChartTypeHandler()void
toggoleOnlyCurrentOfferstoggoleOnlyCurrentOffers()void
switchChartRefernceCommissionHandlerswitchChartRefernceCommissionHandler()void
toggoleBudgetOfferstoggoleBudgetOffers()void
toggoleFirmOfferstoggoleFirmOffers()void
switchFirmOffersswitchFirmOffers()void
switchBudgetOffersswitchBudgetOffers()void
nextPagenextPage()void
prevPageprevPage()void
ngOnDestroyngOnDestroy()void

Properties

PropertyType
_widgetWidget
meAsVendorboolean
isRefernceCommissionboolean
withoutOptionBarboolean
onlyCurrentOffersboolean
numYearsnumber
numYearsDatasourceany[]
_FirmOffersboolean
_BudgetOffersboolean
todayWidgetsEnumany
subscriptionSubscription
branchNamestring
maxValueForYaxisnumber
initOptsany
seriesany[]
headerDataany[]
echartsIntanceany
cachingWidgetDataCachingWidgetData
originalDatasourceWidgetTopOffers[]
datasourceWidgetTopOffers[]
originalHeaderany[]
optionsany
skipnumber

Diagram

mermaid
graph 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

ts
import { 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 ngOnInit and ngOnChanges; do not call lifecycle hooks directly from application code.
  • Keep data loading in getDashboardData() and process returned data through afterResponse().
  • Preserve the existing setChaching() and getChaching() method names when working with cached widget state.
  • Initialize chart event wiring in onChartInit() and keep chart click behavior in onPlannedVisitsChartClick().
  • 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)

  • TranslateHandlerPams/Web/Pams.Web/Client/app/app.module.ts:1
  • WidgetTopOffersByVariantsComponentPams/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?

Download as PDF