import { OnDestroy, OnInit } from "@angular/core"; import { Calculation } from "@salaxy/core"; import { SalaxyContext } from "../../../services/index"; export declare class NgCalcChartComponent implements OnInit, OnDestroy { private context; /** * Calculation that is used i n rendering. * If null, current calculation is taken from the context. */ calc: Calculation; /** Role for which the chart is rendered: employer or worker */ role: "employer" | "worker"; chartLabel: string; chartLabelTable: string[]; scaleYAxis: any; chartType: string; barChartData: any; pieChartLabels: any; pieData: any; showBarChart: boolean; barChartOptions: { legend: { display: boolean; }; tooltips: { enabled: boolean; bodySpacing: number; callbacks: { label(tooltipItem: any, data: any): any; }; }; scales: { xAxes: { stacked: boolean; }[]; yAxes: { stacked: boolean; ticks: { min: number; max: number; }; }[]; }; events: string[]; title: { fullWidth: boolean; }; }; pieChartOptions: { legend: { display: boolean; }; tooltips: { enabled: boolean; mode: string; bodySpacing: number; callbacks: { label(tooltipItem: any, data: any): any; }; }; events: string[]; }; chartColors: { backgroundColor: string; pointBackgroundColor: string; pointHoverBackgroundColor: string; borderColor: string; pointBorderColor: string; pointHoverBorderColor: string; }[]; pieChartColors: { backgroundColor: string[]; pointBackgroundColor: string[]; pointHoverBackgroundColor: string[]; borderColor: string[]; pointBorderColor: string[]; pointHoverBorderColor: string[]; }[]; private colors; private totalExpenses; private totalGrossSalary; private salaryAdditions; private allSideCosts; private employerChartScale; private finalCost; private salaryPayment; private tax; private workerSideCosts; private benefits; private totalWorkerPayment; private workerChartScale; private calculationSubscription; constructor(context: SalaxyContext); /** Initializes the component */ ngOnInit(): void; ngOnDestroy(): void; /** * Executes everything needed for chart generation: * fetched the current calculation, stores needed numbers from that calculation, * checks colors, sets labels and sets chart data */ private doChart(calc); /** * Checks if any overriding colors have been given as an attribute * Checks if colors are valid hex colors, and then replaces default colors */ private checkColors(); /** * Calculates and sets a proper Y axis max value for a given value * @param value The number of the highest bar in chart */ private setChartYAxisLimit(value); /** * Fetches all relevant numbers from the current calculation */ private calculateAllNumbers(calc); /** * Sets the relevant employer data as chart data */ private doChartEmployer(); /** * Sets the relevant worker data as chart data */ private doChartWorker(); }