File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/App/frontend/src/chartComponents Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ const BarChart: React.FC<BarChartProps> = ({
2929 document ?. getElementById ( containerID ) ! . clientWidth || 200 ;
3030 const svg = d3 . select ( chartRef . current ) ;
3131 svg . selectAll ( "*" ) . remove ( ) ; // Clear previous render
32-
32+ d3 . selectAll ( "#tooltip-container" ) . remove ( ) ; // Ensuring the previous tooltip is removed.
3333 const modifiedData : DataWithFullCategoryText [ ] = data . map ( ( ob ) => {
3434 let truncatedCategory = ob . category ;
3535
@@ -95,6 +95,7 @@ const BarChart: React.FC<BarChartProps> = ({
9595 const tooltip = d3
9696 . select ( "body" )
9797 . append ( "div" )
98+ . attr ( "id" , "tooltip-container" ) // Ensure only one tooltip exists
9899 . style ( "position" , "absolute" )
99100 . style ( "background" , "#fff" )
100101 . style ( "padding" , "5px 10px" )
You can’t perform that action at this time.
0 commit comments