Variable: useXAxisDomain
@arolariu/components / useXAxisDomain
Variable: useXAxisDomain
useXAxisDomain: (
xAxisId?) =>NumberDomain|CategoricalDomain
Defined in: components/ui/chart.tsx:642
Returns the calculated domain of an X-axis.
The domain can be numerical: [min, max], or categorical: ['a', 'b', 'c'].
The type of the domain is defined by the type prop of the XAxis.
The values of the domain are calculated based on the data and the dataKey of the axis.
If the chart has a Brush, the domain will be filtered to the brushed indexes if the hook is used outside a Brush context, and the full domain will be returned if the hook is used inside a Brush context.
Parameters
xAxisId?
string | number
The xAxisId of the X-axis. Defaults to 0 if not provided.
Returns
NumberDomain | CategoricalDomain
The domain of the X-axis, or undefined if it cannot be calculated or if used outside a chart context.
Since
3.2