import * as chart_js from 'chart.js'; import { ChartType as ChartType$1, ChartOptions, ChartDataset as ChartDataset$1, ChartConfiguration, TooltipOptions, Plugin } from 'chart.js'; import * as i0 from '@angular/core'; import { ElementRef, AfterViewInit, OnChanges, OnDestroy, SimpleChanges } from '@angular/core'; import { AnnotationType, AnnotationTypeRegistry, AnnotationOptions } from 'chartjs-plugin-annotation'; import * as chartjs_plugin_datalabels_types_options from 'chartjs-plugin-datalabels/types/options'; type ChartHighlightedElements = number[][]; type ChartType = 'column' | 'bar' | 'line' | 'stock'; type ChartTypeConfig = { type: ChartType$1; options?: ChartOptions; }; type ChartTypesConfig = { [key in ChartType]: ChartTypeConfig; }; type ChartLabel = string | string[]; type ChartDataLabelOptions = { showMin?: boolean; showMax?: boolean; showCurrent?: boolean; locale?: ChartLocale; valueSuffix?: string; }; type ChartLocale = 'da-DK' | 'en-US'; type ChartDataset = { kirbyOptions?: { highlightedElements?: number[]; isStockChart?: boolean; }; } & ChartDataset$1; declare function isNumberArray(value: any): value is number[]; declare class ChartConfigService { getTypeConfig(chartType: ChartType): ChartTypeConfig; getAnnotationDefaults(type: AnnotationType): AnnotationTypeRegistry[AnnotationType]; chartTypeToChartJSType(chartType: ChartType): ChartType$1; applyInteractionFunctionsExtensions(options: ChartOptions): ChartOptions; getStockChartOptions(dataLabelOptions: ChartDataLabelOptions, locale: ChartLocale): { locale: ChartLocale; plugins: { tooltip: { callbacks: { title: (tooltipItems: any) => any; label: (context: any) => string; }; }; }; scales: { y: { ticks: { callback: (value: any) => string; }; }; }; }; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class ChartJSService { protected chartConfigService: ChartConfigService; private chart; private highlightedElements; protected chartType: ChartType; private annotationsDelegate; constructor(chartConfigService: ChartConfigService); renderChart(args: { targetElement: ElementRef; type: ChartType; data: ChartDataset[] | number[]; labels?: ChartLabel[]; customOptions?: ChartOptions; annotations?: AnnotationOptions[]; highlightedElements?: ChartHighlightedElements; }): void; redrawChart(): void; destroyChart(): void; updateData(data: ChartDataset[] | number[]): void; updateLabels(labels: ChartLabel[]): void; updateType(type: ChartType, customOptions?: ChartOptions): void; updateOptions(customOptions: ChartOptions, type: ChartType): void; updateAnnotations(annotations: AnnotationOptions[]): void; updateHighlightedElements(highlightedElements?: ChartHighlightedElements): void; protected createOptionsObject(args: { customOptions?: ChartOptions; annotations?: AnnotationOptions[]; }): ChartOptions; protected getDefaultLabels(datasets: ChartDataset[]): ChartLabel | ChartLabel[]; private createConfigurationObject; protected createDatasets(data: ChartDataset[] | number[]): ChartDataset[]; private destructivelyUpdateType; private nonDestructivelyUpdateType; private initializeNewChart; private addHighlightedElementsToDatasets; private getLabelsToApply; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare const TEST_CHART_TYPES_CONFIG: ChartTypesConfig; declare const TEST_CHART_ANNOTATIONS_CONFIG: Omit; declare class BaseChartComponent implements AfterViewInit, OnChanges, OnDestroy { protected chartJSService: ChartJSService; type: ChartType; data: ChartDataset[] | number[]; labels: ChartLabel[]; customOptions?: ChartOptions; annotations?: AnnotationOptions[]; highlightedElements?: ChartHighlightedElements; _height: string; set height(value: string | number); canvasElement: ElementRef; private chartHasBeenRendered; constructor(chartJSService: ChartJSService); ngAfterViewInit(): void; private whenElementHasHeightAndWidth; ngOnChanges(simpleChanges: SimpleChanges): void; protected renderChart(additionalArgs?: any): void; private updateData; private updateLabels; private updateType; private updateCustomOptions; private updateAnnotations; private updateHighlightedElements; private redrawChart; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ChartComponent extends BaseChartComponent { type: Exclude; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class StockChartComponent extends BaseChartComponent { dataLabelOptions?: ChartDataLabelOptions; readonly type = "stock"; protected renderChart(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ChartsModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class ChartBaseConfig { static baseConfig: ChartConfiguration; static tooltipPlugin: Partial>; static registerPlugins: () => void; } /** * This class is still experimental. Feel free to use it, but please note that it is still subject to breaking changes. */ declare class BarChartConfig extends ChartBaseConfig { private static BAR_CHART_LOCALE_DEFAULT; static baseConfig: ChartConfiguration; } interface VerticalLinePlugin extends Plugin { id: string; drawTime: string; line?: { color: string; }; defaults?: { width: number; color: string; }; } /** * This class is still experimental. Feel free to use it, but please note that it is still subject to breaking changes. */ declare class StockChartConfig extends ChartBaseConfig { private static STOCK_CHART_LOCALE_DEFAULT; private static scales; private static elements; private static controllers; private static plugins; private static registeredElements; private static pluginsRegistered; static registerPlugins(): void; static baseConfig: ChartConfiguration; static tooltipPlugin: Partial>; static dataLabelsPluginConfig: Partial; static verticalLinePluginConfig: VerticalLinePlugin; static getDataLabelPosition: (data: chart_js.ScatterDataPoint[], dataIndex: number) => chartjs_plugin_datalabels_types_options.Align | null; } export { BarChartConfig, BaseChartComponent, ChartComponent, ChartConfigService, ChartJSService, ChartsModule, StockChartComponent, StockChartConfig, TEST_CHART_ANNOTATIONS_CONFIG, TEST_CHART_TYPES_CONFIG, isNumberArray }; export type { ChartDataLabelOptions, ChartDataset, ChartHighlightedElements, ChartLabel, ChartLocale, ChartType, ChartTypeConfig, ChartTypesConfig }; //# sourceMappingURL=kirbydesign-designsystem-chart.d.ts.map