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

hide the legend when line series is empty #45

Merged
merged 5 commits into from
Jul 19, 2023

Conversation

ashutosh16
Copy link
Collaborator

@ashutosh16 ashutosh16 commented Jun 30, 2023

Fix the filter based on the groupby
Hide the legend when metrics provide is empty
Show Metric provider not available message when provider return no response

@ashutosh16 ashutosh16 changed the title Fix chart hide the legend when line series is empty Jun 30, 2023
@ashutosh16 ashutosh16 marked this pull request as ready for review June 30, 2023 18:51
});
setFilterChart({ ...filterChart, [groupBy]: newFilter });
}, [chartData, groupBy, setFilterChart]);
if (chartData?.length != 0) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Only when chartData is not empty. This would avoid overriding the values

{XAxisMemo}
{YAxisMemo}
{TooltipMemo}
{chartData?.length > 0 ? LegendMemo : null}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Show legends only if chartData is not empty


{chartData?.length > 0 ? (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Show message when metrics provider returns no data
Screenshot 2023-06-30 at 12 02 41 PM

@@ -130,7 +130,10 @@ export const ChartWrapper = ({
}
const metricObj: ChartDataProps = {
...obj,
name: obj?.metric && typeof obj?.metric?.pod === 'string' ? obj?.metric?.pod: Object.values(obj?.metric).join(":"),
name:
obj?.metric && typeof obj?.metric?.[groupBy] === "string"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@leoluz leoluz left a comment

Choose a reason for hiding this comment

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

LGTM

@leoluz leoluz merged commit f2e63ab into argoproj-labs:main Jul 19, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants