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

[Metric] SparkLine - chart not rendered when the trend is empty #2445

Closed
alexwizp opened this issue May 30, 2024 · 0 comments · Fixed by #2447
Closed

[Metric] SparkLine - chart not rendered when the trend is empty #2445

alexwizp opened this issue May 30, 2024 · 0 comments · Fixed by #2447

Comments

@alexwizp
Copy link
Contributor

Regression of #2411

When the metric chart is visualized with an empty trend, the chart component fails to render, and the following error message appears in the console:
image

How to reproduce:

  1. Configure any Metric chart
  2. Pass [] as value for trend attribute.

Possible solution:

  1. Apply the following fix. This diff represents the change in line 56 of the sparkline.tsx file.
- if (!trend) {
+ if (!trend?.length) {

Screen:

Trend was set to []

image
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 a pull request may close this issue.

1 participant