File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -191,17 +191,22 @@ const Indicator = ({
191191 if ( ! isNaN ( number ) ) {
192192 return number ;
193193 }
194- if ( indicator . raw_data_col . length > 3 ) {
194+ const cleanedData = indicator . raw_data_col . replace ( / ^ [ " ' ] + | [ " ' ] + $ / g, '' ) . trim ( ) ;
195+
196+ if ( cleanedData . length > 9 ) {
197+ // Find the first word
198+ const firstWord = cleanedData . split ( ' ' ) [ 0 ] ;
199+
195200 return (
196201 < span
197202 onMouseEnter = { ( ) => setIsHovered ( true ) }
198203 onMouseLeave = { ( ) => setIsHovered ( false ) }
199204 >
200- { indicator . raw_data_col . substring ( 0 , 3 ) } ...
205+ { firstWord } ...
201206 </ span >
202207 ) ;
203208 } else {
204- return indicator . raw_data_col ;
209+ return cleanedData ;
205210 }
206211 } else {
207212 return hasNoData ? "Data unavailable" : disp_val ;
@@ -229,7 +234,7 @@ const Indicator = ({
229234 className = { `absolute right-0 text-center bottom-full mb-2 bg-white shadow-lg border border-gray-200 z-50
230235 ${ getWidthClass ( ) } p-2` }
231236 >
232- { indicator . raw_data_col }
237+ { indicator . raw_data_col . replace ( / ^ [ " ' ] + | [ " ' ] + $ / g , '' ) . trim ( ) }
233238 </ div >
234239 ) }
235240 </ span >
You can’t perform that action at this time.
0 commit comments