Skip to content

Commit

Permalink
Kavitha|add undefined check for graph units
Browse files Browse the repository at this point in the history
  • Loading branch information
kavitha-sundararajan committed Oct 16, 2024
1 parent 8e6cbd4 commit d91dfc2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/app/clinical/common/utils/c3Chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ Bahmni.Graph.c3Chart = function () {
};

this.render = function (bindTo, graphWidth, config, data) {
var distinctUnits = _.uniq(_.map(data, 'units'));
var distinctUnits = _.uniq(_.filter(_.map(data, 'units'), function (unit) {
return unit !== undefined;
}));
if (distinctUnits.length > 2) {
throw new Error("Cannot display line graphs with concepts that have more than 2 units");
}
Expand Down

0 comments on commit d91dfc2

Please sign in to comment.