Skip to main content

Variable: useYAxisDomain

@arolariu/components


@arolariu/components / useYAxisDomain

Variable: useYAxisDomain

useYAxisDomain: (yAxisId?) => NumberDomain | CategoricalDomain

Defined in: components/ui/chart.tsx:644

Returns the calculated domain of a Y-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 YAxis.

The values of the domain are calculated based on the data and the dataKey of the axis.

Does not interact with Brushes, as Y-axes do not support brushing.

Parameters

yAxisId?

string | number

The yAxisId of the Y-axis. Defaults to 0 if not provided.

Returns

NumberDomain | CategoricalDomain

The domain of the Y-axis, or undefined if it cannot be calculated or if used outside a chart context.

Since

3.2

// was this page useful?