Skip to content

WidgetTopOffersByMarketSegmentsLastNyearsComponent

reference
2 min readUpdated

Kind: Class

Source: Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/widget-top-offers-by-market-segments-last-nyears/widget-top-offers-by-market-segments-last-nyears.component.ts (line 22)

Part of: Pams

WidgetTopOffersByMarketSegmentsLastNyearsComponent is an Angular dashboard widget that loads and displays top offers grouped by market segment across a selected year range. It reacts to lifecycle and value changes, initializes chart behavior, handles chart clicks, assigns year colors, and stores or retrieves 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
switchChartRefernceCommissionHandlerswitchChartRefernceCommissionHandler()void
toggoleOnlyCurrentOfferstoggoleOnlyCurrentOffers()void
toggoleBudgetOfferstoggoleBudgetOffers()void
toggoleFirmOfferstoggoleFirmOffers()void
switchFirmOffersswitchFirmOffers()void
switchBudgetOffersswitchBudgetOffers()void
nextPagenextPage()void
prevPageprevPage()void
ngOnDestroyngOnDestroy()void

Properties

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

Diagram

mermaid
graph LR
    Inputs --> ngOnChanges
    ngOnInit --> getChaching
    getChaching --> getDashboardData
    ngOnChanges --> getDashboardData
    onValueChanged --> setChaching
    onValueChanged --> getDashboardData
    getDashboardData --> afterResponse
    afterResponse --> Chart
    onChartInit --> Chart
    setYearColor --> Chart
    Chart --> onPlannedVisitsChartClick

Usage

ts
import { AfterViewInit, Component, ViewChild } from '@angular/core';
import { WidgetTopOffersByMarketSegmentsLastNyearsComponent } from './widget-top-offers-by-market-segments-last-nyears.component';

@Component({
  selector: 'app-dashboard-host',
  template: `
    <app-widget-top-offers-by-market-segments-last-nyears>
    </app-widget-top-offers-by-market-segments-last-nyears>
  `
})
export class DashboardHostComponent implements AfterViewInit {
  @ViewChild(WidgetTopOffersByMarketSegmentsLastNyearsComponent)
  offersWidget!: WidgetTopOffersByMarketSegmentsLastNyearsComponent;

  ngAfterViewInit(): void {
    this.offersWidget.getChaching();
    this.offersWidget.getDashboardData();
  }

  refreshOffers(): void {
    this.offersWidget.onValueChanged();
  }
}

AI Coding Instructions

  • Keep data loading in getDashboardData() and apply response-dependent state updates in afterResponse().
  • Call setChaching() when widget selections change so cached state matches the current chart state.
  • Use getChaching() during initialization before requesting dashboard data when cached selections are supported.
  • Keep chart setup in onChartInit() and route chart interaction handling through onPlannedVisitsChartClick().
  • Use setYearColor() for chart series colors rather than assigning year colors in multiple locations.

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