Files
ETB/ETB-FrontEnd/node_modules/@mui/x-charts/esm/BarChart/BarLabel/getBarLabel.js
Iliyan Angelov 306b20e24a Frontend start
2025-09-14 00:54:48 +03:00

24 lines
394 B
JavaScript

export const getBarLabel = options => {
const {
barLabel,
value,
dataIndex,
seriesId,
height,
width
} = options;
if (barLabel === 'value') {
// We don't want to show the label if the value is 0
return value ? value?.toString() : null;
}
return barLabel({
seriesId,
dataIndex,
value
}, {
bar: {
height,
width
}
});
};