import { ChartComponent } from "./chart.component"; export interface ChartStyleFull { fill: string | CanvasGradient | CanvasPattern; stroke: string | CanvasGradient | CanvasPattern; lineWidth: number | null; textAlign: CanvasTextAlign; textBaseline: CanvasTextBaseline; opacity: number | null; textStyle: 'italic' | 'bold' | null; fontSize: number; fontFamily: string; lineDashSegments: number[]; } export type ChartStyle = Partial | null; export interface ChartCoordinates { left: number; top: number; width: number; height: number; } export interface ChartPosition { x: number; y: number; } export interface ChartSize { width: number; height: number; } export declare enum SeriesType { BAR = "BAR", LINE = "LINE", LINE_STEP_BEFORE = "LINE_STEP_BEFORE", LINE_STEP_AFTER = "LINE_STEP_AFTER", POINTS = "POINTS", AREA = "AREA", PIE = "PIE" } export declare enum AxisType { LEFT = "LEFT", RIGHT = "RIGHT" } /** * ChartMargin */ export type ChartMargin = { top?: number; right?: number; bottom?: number; left?: number; }; export type ChartPadding = { top?: number; right?: number; bottom?: number; left?: number; }; export interface ChartMarginProcessed { top: number; right: number; bottom: number; left: number; } export interface AxisMaxValueAndMode { value: number | null; mode: MaxMode | null; } export declare enum ChartMode { DEFAULT = "DEFAULT", DATE = "DATE" } export declare enum ChartDateAggregation { HOUR = "HOUR", DAY = "DAY", MONTH = "MONTH", YEAR = "YEAR" } export declare enum ChartDateAggregationMode { MAX = "MAX", MIN = "MIN", SUM = "SUM", FIRST = "FIRST", LAST = "LAST" } export declare enum LabelDisplayMethod { CLOSEST = "CLOSEST", ALL = "ALL" } export type ChartConfiguration = { width?: 'auto' | number; height?: 'auto' | number; /** * Global margin for chart */ margin?: ChartMargin; /** We can set the left and right gap for the bar charts */ barChartGap?: number; /** If we have multiple bar charts set, we can set the gap between the charts */ barChartGapBetween?: number; showLegend?: boolean; series?: Series[]; /** Left axis */ leftAxis?: Axis; /** Right axis */ rightAxis?: Axis; /** Title */ title?: string | null; /** Height of the header in pixels */ headerHeight?: number; /** Margin for header */ headerMargin?: ChartMargin; /** Space between the legend items in pixels */ legendSpaceBetween?: number; /** Legend item size */ legendItemSize?: number; /** Legend space before title */ legendSpaceBeforeTitle?: number; /** Legend title style */ legendTitleStyle?: ChartStyle; /** Show header */ showHeader?: boolean; titleStyle?: ChartStyle | null; backgroundStyle?: ChartStyle; labelTransform?: LabelPipeFunction | null; zoom?: boolean; rangeSelection?: boolean; axisValuePipe?: ChartAxisValuePipeFunction | null; showHorizontalAxis?: boolean; showZeroLine?: boolean; rangeIndexStart?: number | null; rangeIndexEnd?: number | null; mode?: ChartMode; dateAggregation?: ChartDateAggregation; dateAggregationMode?: ChartDateAggregationMode; rangeSelectionLineStyle?: ChartStyle; rangeSelectionRectStyle?: ChartStyle; displayCross?: boolean; crossStyle?: ChartStyle; pieTemplates?: ChartPieTemplate[]; footerLabelStyle?: ChartStyle; footerMarginTop?: number; labelDisplayMethod?: LabelDisplayMethod; horizontalLineStyle?: ChartStyle | null; showHorizontalLines?: boolean; verticalLineStyle?: ChartStyle | null; showVerticalLines?: boolean; fillEmptyDatesWithLastValue?: boolean; }; export interface ProcessedChartConfiguration { width: 'auto' | number; height: 'auto' | number; margin: ChartMargin; barChartGap: number; barChartGapBetween: number; showLegend: boolean; series: ProcessedSeries[]; leftAxis: ProcessedAxis | null; rightAxis: ProcessedAxis | null; title: string | null; headerHeight: number; headerMargin: ChartMargin; legendSpaceBetween: number; legendItemSize: number; legendSpaceBeforeTitle: number; legendTitleStyle: ChartStyle | null; showHeader: boolean; titleStyle: ChartStyle | null; footerLabelStyle: ChartStyle | null; backgroundStyle: ChartStyle; labelTransform: LabelPipeFunction | null; zoom: boolean; rangeSelection: boolean; axisValuePipe: ChartAxisValuePipeFunction | null; showHorizontalAxis: boolean; showZeroLine: boolean; rangeIndexStart: number | null; rangeIndexEnd: number | null; mode: ChartMode; dateAggregation: ChartDateAggregation; dateAggregationMode: ChartDateAggregationMode; rangeSelectionLineStyle: ChartStyle | null; rangeSelectionRectStyle: ChartStyle | null; displayCross: boolean; crossStyle: ChartStyle | null; pieTemplates: ChartPieTemplate[]; footerMarginTop: number; labelDisplayMethod: LabelDisplayMethod; horizontalLineStyle: ChartStyle | null; showHorizontalLines: boolean; verticalLineStyle: ChartStyle | null; showVerticalLines: boolean; fillEmptyDatesWithLastValue: boolean; } export declare enum ChartPieLegendPosition { TOP = "TOP", BOTTOM = "BOTTOM", LEFT = "LEFT", RIGHT = "RIGHT" } export interface ChartPieTemplate { leftPercent: number; topPercent: number; widthPercent: number; heightPercent: number; backgroundStyle?: ChartStyle; itemStyles?: ChartStyle[]; legendPosition?: ChartPieLegendPosition; legendBackgroundStyle?: ChartStyle; legendPadding?: ChartPadding; legendMargin?: ChartPadding; displayLegend?: boolean; legendLabelStyle?: ChartStyle; legendSize?: number; legendGap?: number; legendGapBetween?: number; displayPieValue?: boolean; pieValueStyle?: ChartStyle; } export interface ChartPieTemplateFull { leftPercent: number; topPercent: number; widthPercent: number; heightPercent: number; backgroundStyle: ChartStyle; itemStyles: ChartStyle[]; legendPosition: ChartPieLegendPosition; legendBackgroundStyle: ChartStyle; legendPadding: ChartPadding; legendMargin: ChartPadding; displayLegend: boolean; legendLabelStyle: ChartStyle; legendSize: number; legendGap: number; legendGapBetween: number; displayPieValue: boolean; pieValueStyle: ChartStyle; } export interface ChartArcInformation { startAnglePosition: ChartPosition; endAnglePosition: ChartPosition; middleAnglePosition: ChartPosition; centerPosition: ChartPosition; } export interface ChartDrawColumnSeriesValueInformation { series: ProcessedSeries; seriesIndex: number; value: number; pointPosition: ChartPosition; } export interface ChartDrawColumnInformation { coordinates: ChartCoordinates; index: number; seriesValues: ChartDrawColumnSeriesValueInformation[]; label: string | number; } export type ChartPieTemplateDrawFunctionParams = { chart: ChartComponent; }; export type ChartPieTemplateDrawFunction = (params: ChartPieTemplateDrawFunctionParams) => ChartPieTemplate[]; export type ChartColumnHoverDrawFunctionParams = { chart: ChartComponent; drawColumnInformation: ChartDrawColumnInformation; mouseMoveEventPosition: ChartPosition | null; }; export type ChartColumnHoverDrawFunction = (params: ChartColumnHoverDrawFunctionParams) => void; export type Axis = { max?: number; maxMode?: MaxMode; min?: number; divide?: number; enabled?: boolean; steps?: number; labelStyle?: ChartStyle; showTitle?: boolean; titleSpace?: number; titleStyle?: ChartStyle; visible?: boolean; }; export declare enum MaxMode { EXACT = "EXACT", PERCENT = "PERCENT", INCREMENT = "INCREMENT" } export interface ProcessedAxis { max: number | null; maxMode: MaxMode; min: number | null; divide: number; enabled: boolean; steps: number | null; labelStyle: ChartStyle | null; showTitle: boolean; titleSpace: number; titleStyle: ChartStyle | null; visible: boolean; } export interface ChartSeriesValuePipeFunctionParams { chart: ChartComponent; series: ProcessedSeries; valueInformation: ChartDrawColumnSeriesValueInformation; drawColumnInformation: ChartDrawColumnInformation; } export type ChartSeriesValuePipeFunction = (params: ChartSeriesValuePipeFunctionParams) => string; export interface ChartAxisValuePipeFunctionParams { axisType: AxisType; value: number | null; } export type ChartAxisValuePipeFunction = (params: ChartAxisValuePipeFunctionParams) => string; export interface LabelPipeFunctionParams { label: string | number; } export type LabelPipeFunction = (params: LabelPipeFunctionParams) => string | number; export type SeriesData = ((number | null | undefined) | object | [number, string] | [number, number]); export declare enum SeriesPointMode { ALWAYS = "ALWAYS", NEVER = "NEVER", HOVER = "HOVER" } export declare enum SeriesPointType { SQUARE = "SQUARE", CIRCLE = "CIRCLE" } export interface Series { type: SeriesType; data: SeriesData[]; id?: string; axis?: AxisType; title?: string; showInLegend?: boolean; pointType?: SeriesPointType; pointSize?: number; pointStyle?: ChartStyle; pointMode?: SeriesPointMode; barStyle?: ChartStyle; lineStyle?: ChartStyle; areaStyle?: ChartStyle; pieStyles?: ChartStyle[]; valuePipeFunction?: ChartSeriesValuePipeFunction; labelId?: string; valueId?: string; visible?: boolean; } export interface ProcessedSeries { id: string | number; type: SeriesType; data: SeriesData[]; axis: AxisType; title: string; showInLegend: boolean; processedData: SeriesDataProcessed[]; pointType: SeriesPointType; pointMode: SeriesPointMode; pointSize: number; pointStyle: ChartStyle | null; barStyle: ChartStyle | null; lineStyle: ChartStyle | null; areaStyle: ChartStyle | null; pieStyles: ChartStyle[]; barChartIndex: number; visible: boolean; labelId: string; valueId: string; valuePipeFunction: ChartSeriesValuePipeFunction; } export interface SeriesDataProcessed { label: string | number; value: number | null | undefined; } export interface AxisDrawInfo { min: number; max: number; coordinates: ChartCoordinates; maxLabelWidth: number; steps: number | null; } export interface ChartDrawStartedParams { chart: ChartComponent; } export interface ChartDrawFinishedParams { chart: ChartComponent; } export interface ChartContextMenuItem { title: string; icon: string; action: (() => void) | null; children: ChartContextMenuItem[]; } export interface ChartSvgElementConfiguration { clipPathId?: string; } export interface ChartSvgLineConfiguration extends ChartSvgElementConfiguration { startPosition?: ChartPosition; endPosition?: ChartPosition; } export interface ChartSvgRectConfiguration extends ChartSvgElementConfiguration { startPosition?: ChartPosition; width?: number; height?: number; } export interface ChartSvgPathConfiguration extends ChartSvgElementConfiguration { position?: ChartPosition; width?: number; height?: number; } export interface ChartClipPathDefConfiguration { startPosition?: ChartPosition; width?: number; height?: number; id?: string; } export interface AxisDrawValue { originalValue: (number | null); displayValue: string; skipValueDisplay: boolean; valueScalePercent: number; }