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 4476e1a
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) {

Check failure on line 118 in ui/app/clinical/common/utils/c3Chart.js

View workflow job for this annotation

GitHub Actions / build

Missing space before function parentheses
return unit !== undefined;
}));

Check failure on line 120 in ui/app/clinical/common/utils/c3Chart.js

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 8 spaces but found 10
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 4476e1a

Please sign in to comment.