From a7626d6445d33bba148bf5c18c4822b72e08dfda Mon Sep 17 00:00:00 2001 From: Amy Chen Date: Thu, 14 Nov 2024 14:54:25 -0800 Subject: [PATCH] MME graph - today data point check fix --- src/components/graph/MMEGraph.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/graph/MMEGraph.js b/src/components/graph/MMEGraph.js index 50223d901..b8d31ca97 100644 --- a/src/components/graph/MMEGraph.js +++ b/src/components/graph/MMEGraph.js @@ -461,7 +461,16 @@ export default class MMEGraph extends Component { ]; data = [ ...data, - ...categories.map((o) => ({ ...todayDataPoint, category: o })), + ...categories + .filter( + (c) => + !data.find( + (d) => + d.category === c && + dateFormat("", d[xFieldName], "YYYY-MM-DD") === today + ) + ) + .map((o) => ({ ...todayDataPoint, category: o })), ]; maxDate = new Date(); }