@@ -8,7 +8,7 @@ import { convertRecordObjectToString, recordToNative } from '../ChartUtils';
88import { themeNivo , themeNivoCanvas } from '../Utils' ;
99import { extensionEnabled } from '../../utils/ReportUtils' ;
1010import { getPageNumbersAndNamesList , getRule , performActionOnElement } from '../../extensions/advancedcharts/Utils' ;
11- import { getOriginalRecordForNivoClickEvent , getRecordByCategory } from './util' ;
11+ import { formatToolTipValue , getOriginalRecordForNivoClickEvent , getRecordByCategory } from './util' ;
1212import { BarChartTooltip } from './BarChartTooltip' ;
1313
1414const NeoBarChart = ( props : ChartProps ) => {
@@ -42,7 +42,7 @@ const NeoBarChart = (props: ChartProps) => {
4242 const enableLabel = settings . barValues ? settings . barValues : false ;
4343 const positionLabel = settings . positionLabel ? settings . positionLabel : 'off' ;
4444 // New configurable tooltip property (name of field to show on hover instead of default value)
45- const { tooltipField} = settings ;
45+ const { tooltipField } = settings ;
4646
4747 // New value toggle related settings (primary vs alternate numeric field)
4848 const { alternateValueField } = settings ; // optional second numeric field name
@@ -415,17 +415,22 @@ const NeoBarChart = (props: ChartProps) => {
415415 // Find the original record by matching category and group (not value, since value changes with toggle)
416416 const record = getRecordByCategory ( bar , records , selection , bar ) ;
417417 // Priority1: Display tooltipField value if available, otherwise fall back to bar.value
418- let content = `${ bar . id } - ${ bar . indexValue } : ${ bar . value } ` ;
418+ // Format bar.value if it's an array
419+ let content = `${ bar . id } - ${ bar . indexValue } : <strong>${ formatToolTipValue ( bar . value ) } </strong>` ;
419420 if ( tooltipField && record && record [ tooltipField ] !== undefined ) {
420- content = `${ tooltipField } : ${ record [ tooltipField ] } ` ;
421+ content = `${ tooltipField } : <strong> ${ formatToolTipValue ( record [ tooltipField ] ) } </strong> ` ;
421422 } else if ( record ) {
422423 // Priority 2: Show field based on current mode (alternate or primary)
423424 if ( valueFieldMode === 'alternate' && alternateValueField && record [ alternateValueField ] !== undefined ) {
424425 // Alternate mode: show alternate field
425- content = `${ alternateValueField } - ${ bar . indexValue } : ${ record [ alternateValueField ] } ` ;
426+ content = `${ alternateValueField } - ${ bar . indexValue } : <strong>${ formatToolTipValue (
427+ record [ alternateValueField ]
428+ ) } </strong>`;
426429 } else if ( selection ?. value && record [ selection . value ] !== undefined ) {
427430 // Primary mode: show primary field
428- content = `${ selection . value } - ${ bar . indexValue } : ${ record [ selection . value ] } ` ;
431+ content = `${ selection . value } - ${ bar . indexValue } : <strong>${ formatToolTipValue (
432+ record [ selection . value ]
433+ ) } </strong>`;
429434 }
430435 }
431436 const isDarkMode = props . theme === 'dark' ;
0 commit comments