import { CSSUIObject, PropGetter } from '@yamada-ui/core'; import { Dict } from '@yamada-ui/utils'; import * as Recharts from 'recharts'; import { AreaChartType, ChartAxisType, ChartLayoutType, LabelProps, XAxisProps, YAxisProps } from './chart.types.js'; import 'react'; interface UseChartAxisOptions { /** * The key of a group of data which should be unique in an chart. */ dataKey: string; /** * Controls how chart areas are positioned relative to each other * * @default `default` */ type?: AreaChartType; /** * Specifies which lines should be displayed in the grid. * * @default 'x' */ gridAxis?: ChartAxisType; /** * Chart orientation. * * @default 'horizontal' */ layoutType?: ChartLayoutType; /** * The option is the configuration of tick lines. * * @default 'y' */ tickLine?: ChartAxisType; /** * Unit displayed next to each tick in y-axis. */ unit?: string; /** * If `true`, X axis is visible. * * @default true */ withXAxis?: boolean; /** * If `true`, Y axis is visible. * * @default true */ withYAxis?: boolean; /** * A label to display below the X axis. */ xAxisLabel?: string; /** * A function to format X axis tick. */ xAxisTickFormatter?: (value: any) => string; /** * A label to display below the Y axis. */ yAxisLabel?: string; /** * A function to format Y axis tick. */ yAxisTickFormatter?: (value: any) => string; /** * Props passed down to recharts 'XAxisLabel' component. */ xAxisLabelProps?: LabelProps; /** * Props passed down to recharts 'XAxis' component. */ xAxisProps?: XAxisProps; /** * Props passed down to recharts 'YAxisLabel' component. */ yAxisLabelProps?: LabelProps; /** * Props passed down to recharts 'YAxis' component. */ yAxisProps?: YAxisProps; } interface UseChartAxisProps extends UseChartAxisOptions { styles: Dict; } declare const useChartAxis: ({ type, dataKey, gridAxis, layoutType, styles, tickLine, unit, withXAxis, withYAxis, xAxisLabel: xAxisLabelProp, xAxisTickFormatter, yAxisLabel: yAxisLabelProp, yAxisTickFormatter, ...rest }: UseChartAxisProps) => { getXAxisLabelProps: PropGetter, Recharts.LabelProps>; getXAxisProps: PropGetter, Recharts.XAxisProps>; getYAxisLabelProps: PropGetter, Recharts.LabelProps>; getYAxisProps: PropGetter, Recharts.YAxisProps>; }; export { type UseChartAxisOptions, type UseChartAxisProps, useChartAxis };