@datarailsshared/dr_renderer 1.2.341 → 1.2.342

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/dr_renderer",
3
- "version": "1.2.341",
3
+ "version": "1.2.342",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -5009,7 +5009,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
5009
5009
  })
5010
5010
  };
5011
5011
 
5012
- highchartsRenderer.returnRawDataValue = function (type, value, format, field_name, vals_not_for_convert) {
5012
+ highchartsRenderer.returnRawDataValue = function (type, value, format, field_name, vals_not_for_convert, isFormattingNumbers) {
5013
5013
  if (vals_not_for_convert && vals_not_for_convert.length && lodash.includes(vals_not_for_convert, value)) {
5014
5014
  return value;
5015
5015
  }
@@ -5074,8 +5074,11 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
5074
5074
  return 'Wrong date format';
5075
5075
  }
5076
5076
  } else {
5077
+ const isFormatting = highchartsRenderer.isFormattingAxisFeatureOn() && isFormattingNumbers && format && !isNaN(value);
5077
5078
  if (value === null || value === '[null]') {
5078
5079
  return '[null]';
5080
+ } else if (isFormatting) {
5081
+ return highchartsRenderer.formatValue('n', format, value).value;
5079
5082
  }
5080
5083
  }
5081
5084
 
@@ -8010,7 +8013,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8010
8013
  suboptions: []
8011
8014
  };
8012
8015
 
8013
- highchartsRenderer.getFilterLabel = function (fieldFilter, showTemplateName) {
8016
+ highchartsRenderer.getFilterLabel = function (fieldFilter, showTemplateName, isFormattingNumbers) {
8014
8017
  var displayname;
8015
8018
  if (fieldFilter.new_name)
8016
8019
  displayname = fieldFilter.new_name.replace('RH_DIM_', '');
@@ -8033,7 +8036,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8033
8036
  var tooltip = '';
8034
8037
  var all_vals = [];
8035
8038
  if (fieldFilter.type == 'Date') {
8036
- all_vals = [];
8037
8039
  var invertValueFormatMap = lodash.invert(fieldFilter.valueFormatMap);
8038
8040
  lodash.forEach(fieldFilter.includes, function (val) {
8039
8041
  if (invertValueFormatMap && invertValueFormatMap[val]) {
@@ -8043,6 +8045,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8043
8045
  }
8044
8046
  all_vals.push(val);
8045
8047
  });
8048
+ } else if (isFormattingNumbers && highchartsRenderer.isFormattingAxisFeatureOn()) {
8049
+ all_vals = lodash.map(lodash.cloneDeep(fieldFilter.includes), val =>
8050
+ highchartsRenderer.returnRawDataValue(fieldFilter.type, val, fieldFilter.format || '', null, null, true) + ""
8051
+ );
8046
8052
  } else {
8047
8053
  all_vals = lodash.clone(fieldFilter.includes);
8048
8054
  }
@@ -9333,7 +9339,11 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
9333
9339
  }
9334
9340
 
9335
9341
  highchartsRenderer.isFormattingAxis = function (pivotData) {
9336
- return lodash.includes(lodash.get(document, 'ReportHippo.user.features', []), FEATURES.FORMAT_AXIS) && pivotData.isFormattingAxisLabels;
9342
+ return highchartsRenderer.isFormattingAxisFeatureOn() && pivotData.isFormattingAxisLabels;
9343
+ }
9344
+
9345
+ highchartsRenderer.isFormattingAxisFeatureOn = function () {
9346
+ return lodash.includes(lodash.get(document, 'ReportHippo.user.features', []), FEATURES.FORMAT_AXIS);
9337
9347
  }
9338
9348
 
9339
9349
  // Method for getting formatted kyes for Axis (cols, rows)