@mui/x-charts
Version:
The community edition of the Charts components (MUI X).
15 lines • 513 B
JavaScript
import * as React from 'react';
import { PluginContext } from "./PluginContext.js";
export function useYExtremumGetter(seriesType) {
const {
isInitialized,
data
} = React.useContext(PluginContext);
if (!isInitialized) {
throw new Error(['MUI X: Could not find the plugin context.', 'It looks like you rendered your component outside of a ChartsContainer parent component.'].join('\n'));
}
if (!seriesType) {
return data.yExtremumGetters;
}
return data.yExtremumGetters[seriesType];
}