import type { CSSProperties } from 'react'; import type { YAxisProps } from 'recharts'; import type { IChartBaseProps } from '../../interfaces/IChartBaseProps.js'; import type { IChartDimension } from '../../interfaces/IChartDimension.js'; import type { IChartMeasure } from '../../interfaces/IChartMeasure.js'; interface MeasureConfig extends IChartMeasure { /** * width of the current chart element, defaults to `1` for `lines` and `20` for bars */ width?: number; /** * Opacity * @default 1 */ opacity?: number; /** * Chart type */ type: AvailableChartTypes; /** * bar Stack ID * @default undefined */ stackId?: string; /** * Highlight color of defined elements * @param value {string | number} Current value of the highlighted measure * @param measure {IChartMeasure} Current measure object * @param dataElement {object} Current data element */ highlightColor?: (value: number, measure: MeasureConfig, dataElement: Record) => CSSProperties['color']; } interface DimensionConfig extends IChartDimension { interval?: YAxisProps['interval']; } export interface ComposedChartProps extends IChartBaseProps { /** * An array of config objects. Each object will define one dimension of the chart. * * **Required Properties** * - `accessor`: string containing the path to the dataset key the dimension should display. Supports object structures by using 'parent.child'. * Can also be a getter. * * **Optional Properties** * - `formatter`: function will be called for each data label and allows you to format it according to your needs * - `interval`: number that controls how many ticks are rendered on the x axis * */ dimensions: DimensionConfig[]; /** * An array of config objects. Each object is defining one element in the chart. * * **Required properties** * - `accessor`: string containing the path to the dataset key this element should display. Supports object structures by using 'parent.child'. * Can also be a getter. * - `type`: string which chart element to show. Possible values: `line`, `bar`, `area`. * * **Optional properties** * * - `label`: Label to display in legends or tooltips. Falls back to the accessor if not present. * - `color`: any valid CSS Color or CSS Variable. Defaults to the `sapChart_Ordinal` colors * - `formatter`: function will be called for each data label and allows you to format it according to your needs * - `hideDataLabel`: flag whether the data labels should be hidden in the chart for this element. * - `DataLabel`: a custom component to be used for the data label * - `width`: width of the current chart element, defaults to `1` for `lines` and `20` for bars * - `opacity`: element opacity, defaults to `1` * - `stackId`: bars with the same stackId will be stacked * - `highlightColor`: function will be called to define a custom color of a specific element which matches the * defined condition. Overwrites code>color of the element. * */ measures: MeasureConfig[]; /** * layout for showing measures. `horizontal` bars would equal the column chart, `vertical` would be a bar chart. * Default Value: `horizontal` * * @default `"horizontal"` */ layout?: 'horizontal' | 'vertical'; } type AvailableChartTypes = 'line' | 'bar' | 'area' | string; /** * The `ComposedChart` enables you to combine different chart types in one chart, e.g. showing bars together with lines. * * __Note:__ Charts are custom-built __without__ defined design specifications! They use the Fiori color palette, but functionality and especially accessibility may not meet standard app requirements. */ declare const ComposedChart: import("react").ForwardRefExoticComponent>; export { ComposedChart };