@@ -456,7 +456,7 @@ const HorizontalRatingsChart = ({ questionId, questionTitle, filters = {}, showR
456456
457457 // Determine if percentage text fits inside bar with padding
458458 // Calculate approximate text width: each char ~7px, padding pl-2 pr-2 = 16px total
459- const percentageText = `${ Math . round ( item . percentage ) } %` ;
459+ const percentageText = Math . round ( item . percentage ) === 0 && item . count > 0 ? '<1%' : `${ Math . round ( item . percentage ) } %` ;
460460 const textWidth = percentageText . length * 7 ; // approximate char width for text-xs font-bold
461461 const paddingWidth = 16 ; // pl-2 (8px) + pr-2 (8px)
462462 const minRequiredWidth = textWidth + paddingWidth ;
@@ -501,7 +501,7 @@ const HorizontalRatingsChart = ({ questionId, questionTitle, filters = {}, showR
501501 { /* Percentage inside the bar on the left (only if it fits) */ }
502502 { percentageFitsInside && (
503503 < span className = "text-white text-xs font-bold pl-2 pr-2" >
504- { Math . round ( item . percentage ) } %
504+ { Math . round ( item . percentage ) === 0 && item . count > 0 ? '<1%' : ` ${ Math . round ( item . percentage ) } %` }
505505 </ span >
506506 ) }
507507 </ div >
@@ -523,7 +523,7 @@ const HorizontalRatingsChart = ({ questionId, questionTitle, filters = {}, showR
523523 { /* Show percentage closest to bar, then descriptor */ }
524524 { ! percentageFitsInside && (
525525 < span className = "text-gray-900 text-xs font-bold whitespace-nowrap" >
526- { Math . round ( item . percentage ) } %
526+ { Math . round ( item . percentage ) === 0 && item . count > 0 ? '<1%' : ` ${ Math . round ( item . percentage ) } %` }
527527 </ span >
528528 ) }
529529 < span className = "text-gray-700 text-xs font-semibold uppercase whitespace-nowrap" >
@@ -545,7 +545,7 @@ const HorizontalRatingsChart = ({ questionId, questionTitle, filters = {}, showR
545545 { /* Show percentage closest to bar if it doesn't fit inside, then descriptor */ }
546546 { ! percentageFitsInside && (
547547 < span className = "text-gray-900 text-xs font-bold whitespace-nowrap" >
548- { Math . round ( item . percentage ) } %
548+ { Math . round ( item . percentage ) === 0 && item . count > 0 ? '<1%' : ` ${ Math . round ( item . percentage ) } %` }
549549 </ span >
550550 ) }
551551 < span className = "text-gray-700 text-xs font-semibold uppercase whitespace-nowrap" >
0 commit comments