Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upcoming: [DI-21842] - Fixed recharts issues in Cloudpulse #11317

Merged
merged 10 commits into from
Nov 27, 2024
4 changes: 4 additions & 0 deletions packages/manager/src/components/AreaChart/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export const generate12HourTicks = (
const startTime = data[0].timestamp;
const endTime = data[data.length - 1].timestamp;

if (tickCount === 1) {
return [(startTime + endTime) / 2];
}

// Calculate duration in hours
const duration = DateTime.fromMillis(endTime, { zone: timezone }).diff(
DateTime.fromMillis(startTime, { zone: timezone }),
Expand Down
4 changes: 1 addition & 3 deletions packages/manager/src/components/LineGraph/MetricsDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,8 @@ export const MetricsDisplay = ({
'.MuiTable-root': {
border: 0,
},
height: legendHeight,
overflowY: 'auto',
[theme.breakpoints.up(1100)]: {
height: legendHeight,
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaalah-akamai I've removed this breakpoint condition for legend row heights based on our discussion in the thursday's call

})}
aria-label="Stats and metrics"
stickyHeader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ export const CloudPulseLineGraph = React.memo((props: CloudPulseLineGraph) => {
) : (
<AreaChart
{...rest}
xAxisTickCount={
isSmallScreen ? undefined : Math.min(rest.data.length, 7)
}
fillOpacity={0.5}
legendHeight={theme.spacing(16)}
xAxisTickCount={isSmallScreen ? undefined : 7}
legendHeight={theme.spacing(18)}
/>
)}
{rest.data.length === 0 && (
Expand Down