From 07e15b5e2e775db14ba1e384e7b5ebd3613f5cbb Mon Sep 17 00:00:00 2001 From: Ankush Behl Date: Thu, 18 Apr 2019 12:09:33 +0530 Subject: [PATCH] [Fix] if value is null return 0 --- src/components/Dashboard/Utilization/UtilizationItem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Dashboard/Utilization/UtilizationItem.js b/src/components/Dashboard/Utilization/UtilizationItem.js index 0a4ac499b..2caa8cb92 100644 --- a/src/components/Dashboard/Utilization/UtilizationItem.js +++ b/src/components/Dashboard/Utilization/UtilizationItem.js @@ -50,7 +50,7 @@ export class UtilizationItem extends React.PureComponent { if (isLoading) { chart = ; } else if (data) { - const chartData = data.map((val, index) => ({ x: index, y: Number(val.toFixed(1)) })); + const chartData = data.map((val, index) => ({ x: index, y: val ? Number(val.toFixed(1)) : 0 })); actual = `${Math.round(data[data.length - 1])} ${unit}`; chart = (