diff --git a/libs/shared/lib/vis/visualizations/vis1D/components/CustomChartPlotly.tsx b/libs/shared/lib/vis/visualizations/vis1D/components/CustomChartPlotly.tsx index 08c250feac7374ba44b2e6e6bf7b963d5b4c8afa..1a42de7e7cb8755510d238f49f7e93ddf65a1bb3 100644 --- a/libs/shared/lib/vis/visualizations/vis1D/components/CustomChartPlotly.tsx +++ b/libs/shared/lib/vis/visualizations/vis1D/components/CustomChartPlotly.tsx @@ -113,7 +113,7 @@ export const CustomChartPlotly: React.FC<CustomChartPlotlyProps> = ({ }) => { const internalRef = useRef<HTMLDivElement>(null); const [divSize, setDivSize] = useState({ width: 0, height: 0 }); - const [hoveredPoint, setHoveredPoint] = useState<{ left: number; top: number; value: number } | null>(null); + const [hoveredPoint, setHoveredPoint] = useState<{ left: number; top: number; xValue: number; yValue: number } | null>(null); useEffect(() => { const handleResize = () => { @@ -147,7 +147,8 @@ export const CustomChartPlotly: React.FC<CustomChartPlotlyProps> = ({ setHoveredPoint({ left: plotRect.left + xIndex, top: plotRect.top + yIndex, - value: point.y, + xValue: point.x, + yValue: point.y, }); } } @@ -218,7 +219,7 @@ export const CustomChartPlotly: React.FC<CustomChartPlotlyProps> = ({ }} > <div> - <strong>Value:</strong> {hoveredPoint.value} <br /> + <strong>{hoveredPoint.xValue}</strong>: {hoveredPoint.yValue} </div> </TooltipContent> </Tooltip>