Skip to content

Commit

Permalink
fix (Metric): chart not rendered when the trend is empty
Browse files Browse the repository at this point in the history
Closes: elastic#2445
  • Loading branch information
alexwizp committed May 30, 2024
1 parent 347d7e8 commit 4a64b6a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const SparkLine: FunctionComponent<{
id: string;
datum: MetricWTrend;
}> = ({ id, datum: { color, trend, trendA11yTitle, trendA11yDescription, trendShape } }) => {
if (!trend) {
if (!trend?.length) {
return null;
}
const sortedTrendData = getSortedData(trend);
Expand Down

0 comments on commit 4a64b6a

Please sign in to comment.