From ea15d9cd62590059cecc739402a29299c78d8eac Mon Sep 17 00:00:00 2001 From: Stanley Date: Thu, 28 Mar 2024 14:42:12 +0200 Subject: [PATCH] 37 issue with table html dom (#40) * tr thead error fixed * Adjusted tooltip width * Edited tooltip position and value and y position * console log removed * fix: ensure tick labels are positioned correctly --------- Co-authored-by: Sampo Savolainen --- .../TemperatureComponent.css | 2 +- .../TemperatureComponent.tsx | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/TemperatureComponent/TemperatureComponent.css b/src/components/TemperatureComponent/TemperatureComponent.css index 517a159..3a25a9d 100644 --- a/src/components/TemperatureComponent/TemperatureComponent.css +++ b/src/components/TemperatureComponent/TemperatureComponent.css @@ -36,6 +36,6 @@ .temperature-component-td:hover .tooltip { display: block; - min-width: 26%; + min-width: 20%; font-size: 0.8rem; } diff --git a/src/components/TemperatureComponent/TemperatureComponent.tsx b/src/components/TemperatureComponent/TemperatureComponent.tsx index ea3837d..edd9a6c 100644 --- a/src/components/TemperatureComponent/TemperatureComponent.tsx +++ b/src/components/TemperatureComponent/TemperatureComponent.tsx @@ -50,11 +50,13 @@ export const TemperatureComponent = (options: TemperatureProps) => { const tableContent = ( + {xLabelWithDataValue.map((month, index) => ( ))} + {calculatedData @@ -78,25 +80,28 @@ export const TemperatureComponent = (options: TemperatureProps) => { backgroundColor: `${cell?.bgColor}`, borderRight: "4px solid white", }} - > + > + {cell?.value && ( + {xLabelWithDataValue[cellIndex].xLabels}: -{Number(rowData.yValueNumber).toFixed(1)}m, {cell.value}{"°C"} + )} + ))} {rowIndex === 0 && (
{month.xLabels}
{options.ticks.map((tick) => ( - -{tick} + -{tick} ))}