-
Notifications
You must be signed in to change notification settings - Fork 27
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
Conversation
}); | ||
setFilterChart({ ...filterChart, [groupBy]: newFilter }); | ||
}, [chartData, groupBy, setFilterChart]); | ||
if (chartData?.length != 0) { |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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 ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name is based on the metricName config
https://github.com/argoproj-labs/argocd-extension-metrics/blob/main/app/config.json#L44
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: ashutosh16 <[email protected]>
Signed-off-by: ashutosh16 <[email protected]>
Signed-off-by: ashutosh16 <[email protected]>
Signed-off-by: ashutosh16 <[email protected]>
Signed-off-by: ashutosh16 <[email protected]>
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