Address CodeRabbit review on system resources widget PR
- Render the chart tooltip via a portal so it isn't clipped by the card's overflow:hidden (needed to stop the chart line itself bleeding past its rounded corners). - Move chartColumns' width breakpoints into a lookup table and memoize the computed value, instead of an inline ternary.
This commit is contained in:
1 parent
26d12d9fad
commit
73de83b48f
2 files changed
+19
-2
No files matched your search
@@ -127,7 +127,12 @@ export const CommonChart = ({
|
||||
},
|
||||
}}
|
||||
tooltipAnimationDuration={200}
|
||||
tooltipProps={tooltipProps}
|
||||
tooltipProps={{
|
||||
// Render via portal so the tooltip isn't clipped by the card's overflow:hidden
|
||||
// (needed to stop the chart line itself bleeding past its rounded corners).
|
||||
portal: typeof document !== "undefined" ? document.body : undefined,
|
||||
...tooltipProps,
|
||||
}}
|
||||
withTooltip={height >= 64}
|
||||
yAxisProps={yAxisProps}
|
||||
fillOpacity={chartType === "area" ? 0.3 : undefined}
|
||||
|
||||
Reference in new issue
Block a user