@rinminase/ng-charts
Version:
Reactive, responsive, beautiful charts for Angular based on ng2-charts
74 lines (73 loc) • 3.33 kB
TypeScript
import { DoCheck, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from "@angular/core";
import * as chartJs from "chart.js";
import { DatasetColor } from "./color";
import { ThemeService } from "./theme.service";
import * as i0 from "@angular/core";
export declare type SingleDataSet = number[] | chartJs.ChartPoint[];
export declare type MultiDataSet = (number[] | chartJs.ChartPoint[])[];
export declare type SingleOrMultiDataSet = SingleDataSet | MultiDataSet;
export declare type PluginServiceGlobalRegistrationAndOptions = chartJs.PluginServiceGlobalRegistration & chartJs.PluginServiceRegistrationOptions;
export declare type SingleLineLabel = string;
export declare type MultiLineLabel = string[];
export declare type ChartLabel = SingleLineLabel | MultiLineLabel;
export declare type ChartColor = DatasetColor[];
export declare type ChartType = chartJs.ChartType;
export declare type ChartDataset = chartJs.ChartDataSets;
export declare type ChartDatasets = chartJs.ChartDataSets[];
export declare type ChartOptions = chartJs.ChartOptions;
export declare class BaseChartDirective implements OnDestroy, OnChanges, OnInit, OnDestroy, DoCheck {
private element;
private themeService;
data: SingleOrMultiDataSet;
datasets: ChartDatasets;
labels: ChartLabel[];
options: ChartOptions;
chartType: ChartType;
colors: DatasetColor[];
legend: boolean;
plugins: PluginServiceGlobalRegistrationAndOptions[];
chartClick: EventEmitter<{
event?: MouseEvent;
active?: {}[];
}>;
chartHover: EventEmitter<{
event: MouseEvent;
active: {}[];
}>;
ctx: string;
chart: Chart;
private old;
private subs;
/**
* Register a plugin.
*/
static registerPlugin(plugin: PluginServiceGlobalRegistrationAndOptions): void;
static unregisterPlugin(plugin: PluginServiceGlobalRegistrationAndOptions): void;
constructor(element: ElementRef, themeService: ThemeService);
ngOnInit(): void;
private themeChanged;
ngDoCheck(): void;
copyLabel(a: ChartLabel): ChartLabel;
labelsEqual(a: ChartLabel, b: ChartLabel): boolean;
copyColor(a: DatasetColor): DatasetColor;
colorsEqual(a: DatasetColor, b: DatasetColor): boolean;
updateColors(): void;
ngOnChanges(changes: SimpleChanges): void;
ngOnDestroy(): void;
update(duration?: any): {};
hideDataset(index: number, hidden: boolean): void;
isDatasetHidden(index: number): boolean;
toBase64Image(): string;
getChartConfiguration(): chartJs.ChartConfiguration;
getChartBuilder(ctx: string): Chart;
smartMerge(options: any, overrides: any, level?: number): any;
private isMultiLineLabel;
private joinLabel;
private propagateDatasetsToData;
private propagateDataToDatasets;
private isMultiDataSet;
private getDatasets;
private refresh;
static ɵfac: i0.ɵɵFactoryDeclaration<BaseChartDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseChartDirective, "canvas[baseChart]", ["base-chart"], { "data": "data"; "datasets": "datasets"; "labels": "labels"; "options": "options"; "chartType": "chartType"; "colors": "colors"; "legend": "legend"; "plugins": "plugins"; }, { "chartClick": "chartClick"; "chartHover": "chartHover"; }, never, never, false>;
}