@mui/x-charts
Version:
The community edition of the Charts components (MUI X).
10 lines • 398 B
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
export function defaultizeValueFormatter(series, defaultValueFormatter) {
const defaultizedSeries = {};
Object.keys(series).forEach(seriesId => {
defaultizedSeries[seriesId] = _extends({}, series[seriesId], {
valueFormatter: series[seriesId].valueFormatter ?? defaultValueFormatter
});
});
return defaultizedSeries;
}