import React from 'react'; import type { ViewStyle } from 'react-native'; import type { DataValue, HeaderConfig, Series, StyleConfig, XAxisConfig, YAxisConfig } from '../types'; /** * Props for the ColumnChart component. * * @property data - The data to be displayed in the chart. Each item represents a series. * @property yAxisConfig - Optional configuration for the Y axis. * @property xAxisConfig - Optional configuration for the X axis. * @property style - Additional style for the root View. Follows the same convention as other components (e.g., Button). * @property testID - Testing id of the component. Passed to the root View and used as a suffix for inner elements. * @property headerConfig - Optional header configuration (title, actions). * @property emptyText - Optional text to display when data is empty. * @property onBarPress - Called when a bar (column segment) is pressed. Receives info about the bar. */ export interface ColumnChartProps { /** * The data to be displayed in the chart. Each item represents a series. */ data: Array>>; /** * Optional configuration for the Y axis. * Note: minValue is omitted and always set to zero internally by the component. */ yAxisConfig?: Omit; /** * Optional configuration for the X axis. */ xAxisConfig?: XAxisConfig; /** * Additional style for the root View. */ style?: ViewStyle; /** * Testing id of the component. */ testID?: string; /** * Header configuration for the chart. */ headerConfig?: HeaderConfig; /** * Text to display when the chart has no data (empty state). */ emptyText?: string; /** * Called when a bar (column segment) is pressed. Receives info about the bar. */ onBarPress?: (info: { value: number | undefined; xLabel: string; seriesLabel: string; seriesIndex: number; xIndex: number; }) => void; /** * * styleConfig use to custom the style of the chart. * * styleConfig must be an object: * * color?: use to custom the legend colors. */ styleConfig?: StyleConfig; } /** * ColumnChart component for rendering grouped/stacked column charts. * Handles layout, axis configuration, empty state, and data validation. * Uses ChartFrame for layout and axes, and ColumnChartContent for rendering columns. * * @param data - Array of series, each with a label and array of values. * @param yAxisConfig - Optional Y axis configuration. * @param xAxisConfig - Optional X axis configuration. * @param style - Optional style for the chart container. * @param testID - Optional test ID for testing. * @param headerConfig - Optional header configuration (title, actions). * @param emptyText - Optional text to display when data is empty. * @param onBarPress - Called when a bar (column segment) is pressed. Receives info about the bar. * * Example usage: * */ declare const ColumnChart: ({ data, yAxisConfig, xAxisConfig, style, testID, headerConfig, emptyText, onBarPress, styleConfig, }: ColumnChartProps) => React.JSX.Element; export default ColumnChart;