UNPKG

2.49 kBTypeScriptView Raw
1import { ElementRef, EventEmitter, NgZone, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2import { Chart, ChartConfiguration, ChartEvent, ChartType, DefaultDataPoint, Plugin, UpdateMode } from 'chart.js';
3import { ThemeService } from './theme.service';
4import { NgChartsConfiguration } from './ng-charts.provider';
5import * as i0 from "@angular/core";
6export declare class BaseChartDirective<TType extends ChartType = ChartType, TData = DefaultDataPoint<TType>, TLabel = unknown> implements OnDestroy, OnChanges {
7 private zone;
8 private themeService;
9 type: ChartConfiguration<TType, TData, TLabel>['type'];
10 legend?: boolean;
11 data?: ChartConfiguration<TType, TData, TLabel>['data'];
12 options: ChartConfiguration<TType, TData, TLabel>['options'];
13 plugins: Plugin<TType>[];
14 labels?: ChartConfiguration<TType, TData, TLabel>['data']['labels'];
15 datasets?: ChartConfiguration<TType, TData, TLabel>['data']['datasets'];
16 chartClick: EventEmitter<{
17 event?: ChartEvent;
18 active?: object[];
19 }>;
20 chartHover: EventEmitter<{
21 event: ChartEvent;
22 active: object[];
23 }>;
24 ctx: string;
25 chart?: Chart<TType, TData, TLabel>;
26 private subs;
27 private themeOverrides;
28 constructor(element: ElementRef, zone: NgZone, themeService: ThemeService, config?: NgChartsConfiguration);
29 ngOnChanges(changes: SimpleChanges): void;
30 ngOnDestroy(): void;
31 render(): Chart<TType, TData, TLabel>;
32 update(mode?: UpdateMode): void;
33 hideDataset(index: number, hidden: boolean): void;
34 isDatasetHidden(index: number): boolean | undefined;
35 toBase64Image(): string | undefined;
36 private themeChanged;
37 private getChartOptions;
38 private getChartConfiguration;
39 private getChartData;
40 static ɵfac: i0.ɵɵFactoryDeclaration<BaseChartDirective<any, any, any>, [null, null, null, { optional: true; }]>;
41 static ɵdir: i0.ɵɵDirectiveDeclaration<BaseChartDirective<any, any, any>, "canvas[baseChart]", ["base-chart"], { "type": { "alias": "type"; "required": false; }; "legend": { "alias": "legend"; "required": false; }; "data": { "alias": "data"; "required": false; }; "options": { "alias": "options"; "required": false; }; "plugins": { "alias": "plugins"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "datasets": { "alias": "datasets"; "required": false; }; }, { "chartClick": "chartClick"; "chartHover": "chartHover"; }, never, never, true, never>;
42}