From 694fc74ca0264cda42723d90f4d5169e1b4a8c68 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Sun, 27 Jun 2021 13:44:01 -0700 Subject: [PATCH] fixing history. --- .../src/app/modules/detail/detail.component.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/webapp/frontend/src/app/modules/detail/detail.component.ts b/webapp/frontend/src/app/modules/detail/detail.component.ts index eaf5b7c..df396b6 100644 --- a/webapp/frontend/src/app/modules/detail/detail.component.ts +++ b/webapp/frontend/src/app/modules/detail/detail.component.ts @@ -235,12 +235,20 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy { //chart history data if (!attr.chartData) { - var rawHistory = (attr.history || []).map(hist_attr => this.getAttributeValue(hist_attr)).reverse() - rawHistory.push(this.getAttributeValue(attr)) - attr.chartData = [ + + + var attrHistory = [] + for (let smart_result of smart_results){ + attrHistory.push(this.getAttributeValue(smart_result.attrs[attrId])) + } + + // var rawHistory = (attr.history || []).map(hist_attr => this.getAttributeValue(hist_attr)).reverse() + // rawHistory.push(this.getAttributeValue(attr)) + + attributes[attrId].chartData = [ { name: "chart-line-sparkline", - data: rawHistory + data: attrHistory } ] }