@dhis2/analytics 2.4.45 → 2.4.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [2.4.46](https://github.com/dhis2/analytics/compare/v2.4.45...v2.4.46) (2022-01-07)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * hide empty categories with non-available data DHIS2-8174 ([#1121](https://github.com/dhis2/analytics/issues/1121)) ([c80f3ba](https://github.com/dhis2/analytics/commit/c80f3ba6d833ea38f51d4e695832831ebcbc0c1e))
7
+
1
8
  ## [2.4.45](https://github.com/dhis2/analytics/compare/v2.4.44...v2.4.45) (2021-11-25)
2
9
 
3
10
 
@@ -29,8 +29,11 @@ function getEmptySeriesIndexes(series) {
29
29
  var seriesValues;
30
30
  series[0].data.forEach(function (value, index) {
31
31
  seriesValues = [];
32
- series.forEach(function (seriesObj) {
33
- seriesValues.push(seriesObj.data[index]);
32
+ series.forEach(function (_ref) {
33
+ var data = _ref.data;
34
+ // handle undefined values due to empty (or shorter) serie data
35
+ // preserve 0 as valid value
36
+ seriesValues.push(data[index] === undefined ? null : data[index]);
34
37
  });
35
38
 
36
39
  if (arrayNullsOnly(seriesValues)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2/analytics",
3
- "version": "2.4.45",
3
+ "version": "2.4.46",
4
4
  "main": "./build/index.js",
5
5
  "repository": "git@github.com:dhis2/analytics.git",
6
6
  "author": "Jennifer Jones Arnesen <jennifer@dhis2.org>",