Skip to content

Commit

Permalink
fixed combined array const issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lovedeep92 committed May 17, 2021
1 parent 8bc02e3 commit 729a489
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/line-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ export class LineGraph extends HTMLElement {
});
this.shadowRoot.appendChild(svg);
var newData = this.formatMutlipleData(data, this.dataset.group);
if(newData.length > 0) {
this.renderGraph(this.parseData(newData), svg);
}
this.renderGraph(this.parseData(newData), svg);
}


Expand All @@ -62,7 +60,6 @@ export class LineGraph extends HTMLElement {
formatMutlipleData(records, groupName) {
var arr = [];
var group, keys, values, res;
const combinedArray = [];
for (let data of records) {
group = this.findByProp(data, groupName);
keys = Object.keys(data.values);
Expand All @@ -76,7 +73,7 @@ export class LineGraph extends HTMLElement {
});
arr.push(res);
}
combinedArray.concat(...arr);
const combinedArray = [].concat(...arr);
return combinedArray;
}

Expand Down

0 comments on commit 729a489

Please sign in to comment.