Skip to content

Commit

Permalink
Merge branch 'master' of github.com:nzzdev/Q-chart
Browse files Browse the repository at this point in the history
  • Loading branch information
benib committed Nov 11, 2017
2 parents 47f4cfc + 2088f06 commit 7490f93
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions routes/dynamic-enum.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ function getHighlightEnumTitles(item) {

function getPrognosisStartEnum(item) {
try {
return [null].concat(Object.keys(getFirstColumnSerie(item.data).map(key => parseInt(key))));
// constructs an array like [null,0,1,2,3,...] with the indexes from the first data column
return [null].concat([...getFirstColumnSerie(item.data).keys()]);
} catch (e) {
return [null]
}
Expand Down Expand Up @@ -58,4 +59,4 @@ module.exports = {

return reply(Boom.badRequest());
}
}
}

0 comments on commit 7490f93

Please sign in to comment.