UNPKG

1.19 kBTypeScriptView Raw
1import { InjectionToken } from '@angular/core';
2import { ChartComponentLike, Defaults } from 'chart.js';
3import { DeepPartial } from 'chart.js/dist/types/utils';
4export declare const NG_CHARTS_CONFIGURATION: InjectionToken<NgChartsConfiguration>;
5export type NgChartsConfiguration = {
6 /**
7 * Any registerable that can be used with `Chart.register()`, such as plugins, controllers, scales, and elements.
8 */
9 registerables?: readonly ChartComponentLike[];
10 /**
11 * Default configuration that can be used with `defaults.set()`.
12 */
13 defaults?: DeepPartial<Defaults>;
14};
15/**
16 * Provide all the default registerable as defined by Chart.js
17 */
18export declare function withDefaultRegisterables(...registerables: ChartComponentLike[]): NgChartsConfiguration;
19/**
20 * Provide configuration for ngCharts. In most cases, you have to pass it some registerables. So either
21 * `withDefaultRegisterables()`, or a custom list of registerables tailored to your needs to reduce bundle size.
22 */
23export declare function provideCharts(...configurations: readonly NgChartsConfiguration[]): {
24 provide: InjectionToken<NgChartsConfiguration>;
25 useValue: NgChartsConfiguration;
26};