import * as am4charts from '@amcharts/amcharts4/charts'; import * as am4maps from '@amcharts/amcharts4/maps'; import { EventEmitter, NgZone, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; import { TsAmChartsService } from './amcharts.service'; /** * Define the supported chart visualizations */ export declare type TsChartVisualizationOptions = 'xy' | 'pie' | 'map' | 'radar' | 'tree' | 'sankey' | 'chord'; /** * Define possible chart types */ export declare type TsChart = am4charts.XYChart | am4charts.PieChart | am4maps.MapChart | am4charts.RadarChart | am4charts.TreeMap | am4charts.SankeyDiagram | am4charts.ChordDiagram; /** * This is the chart UI Component * * FIXME: Once amCharts v4 is TypeScript script compliant, we should set the `tsconfig.skipLibCheck` to true. * https://github.com/GetTerminus/terminus-ui/issues/1327 * * @example * * * https://getterminus.github.io/ui-demos-release/components/chart */ export declare class TsChartComponent implements OnInit, OnChanges, OnDestroy { private zone; private amChartsService; /** * Store the initialized chart */ chart: TsChart | undefined; /** * Save a reference to the underlying amCharts library */ private readonly amCharts; /** * Get access to the chart container */ private chartDiv; /** * Define the chart visualization format (bar, line, etc) * * @param value - The visualization type. {@link TsChartVisualizationOptions} */ set visualization(value: TsChartVisualizationOptions); get visualization(): TsChartVisualizationOptions; private _visualization; /** * Emit an event containing the chart each time it is initialized */ readonly chartInitialized: EventEmitter; constructor(zone: NgZone, amChartsService: TsAmChartsService); /** * Initialize the chart if amCharts exists */ ngOnInit(): void; /** * Re-initialize the chart if the visualization type has changed * * @param changes */ ngOnChanges(changes: SimpleChanges): void; /** * Destroy the chart when the component is destroyed */ ngOnDestroy(): void; /** * A function to verify the initialization requirements before creating the chart */ private protectedInitialize; /** * Destroy the chart */ private destroyChart; /** * Initialize a chart * * @param type */ private createChart; }