diff --git a/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx b/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx index 5ec4783c195..16e51f26283 100644 --- a/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx +++ b/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx @@ -111,13 +111,17 @@ const CustomTooltip = ({ } }; -const customLabel = props => { +const customLabel = (props, typeOp) => { const calcX = props.x + props.width / 2; const calcY = props.y - (props.value > 0 ? 15 : -15); const textAnchor = 'middle'; const display = props.value !== 0 && `${amountToCurrencyNoDecimal(props.value)}`; - const textSize = adjustTextSize(props.width, 'variable', props.value); + const textSize = adjustTextSize( + props.width, + typeOp === 'totalTotals' ? 'default' : 'variable', + props.value, + ); return renderCustomLabel(calcX, calcY, textAnchor, display, textSize); }; @@ -226,7 +230,7 @@ export function BarGraph({ {viewLabels && !compact && ( getVal(val)} - content={customLabel} + content={e => customLabel(e, balanceTypeOp)} /> )} {data.legend.map((entry, index) => ( @@ -240,7 +244,10 @@ export function BarGraph({ {yAxis === 'date' && balanceTypeOp === 'totalTotals' && ( {viewLabels && !compact && ( - + customLabel(e, balanceTypeOp)} + /> )} {data[splitData].map((entry, index) => ( { return !showLabel || Math.abs(showLabel) > showLabelThreshold ? (