@datarailsshared/dr_renderer 1.2.47-beta → 1.2.49-beta

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.47-beta",
3
+ "version": "1.2.49-beta",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -1004,7 +1004,7 @@ var DataFormatterImpl = function () {
1004
1004
  // Call function
1005
1005
  result = this.memoized[pattern].call(this, n, type);
1006
1006
 
1007
- if (result.value === result.pattern) {
1007
+ if (result.value === result.pattern && !(String(n) === '0' && result.value.includes('0'))) {
1008
1008
  result.value = n;
1009
1009
  }
1010
1010
  }
@@ -3,7 +3,7 @@ let initDRPivotTable = function($, window, document) {
3
3
  var slice = [].slice;
4
4
  var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
5
5
 
6
- var DRPivotData, sortDateStrings, getSort, processKey, SubtotalRenderer, getFormattedNumber, largeToSmallSort, NovixRenderer;
6
+ var DRPivotData, sortDateStrings, getSort, processKey, SubtotalRenderer, getFormattedNumber, largeToSmallSort, largeToSmallSortByAbsolute, NovixRenderer;
7
7
 
8
8
  var delim = " , ";
9
9
  const newTableColors = ['rgb(127, 196, 255)', 'rgb(200, 243,243)', 'rgb(247, 161, 173)', 'rgb(255, 237, 178)', 'rgb(221, 239, 255)',
@@ -155,7 +155,7 @@ let initDRPivotTable = function($, window, document) {
155
155
  totals[flatKey].push(record);
156
156
  }
157
157
  }
158
- if (addKey) {
158
+ if (addKey && key.length === attrs.length) {
159
159
  keys.push(key);
160
160
  }
161
161
  return key;
@@ -180,13 +180,13 @@ let initDRPivotTable = function($, window, document) {
180
180
  if (!colKey.length && !rowKey.length) {
181
181
  this.allTotal.push(record);
182
182
  }
183
- if (!colKey.length && rowKey.length === 1) {
184
- this.rowTotals[rowKey[0]].push(record);
185
- this.rowTotals[rowKey[0]].isChangeable = true;
183
+ if (!colKey.length && rowKey.length) {
184
+ this.rowTotals[rowKey.join(delim)].push(record);
185
+ this.rowTotals[rowKey.join(delim)].isChangeable = true;
186
186
  }
187
- if (!rowKey.length && colKey.length === 1) {
188
- this.colTotals[colKey[0]].push(record);
189
- this.colTotals[colKey[0]].isChangeable = true;
187
+ if (!rowKey.length && colKey.length) {
188
+ this.colTotals[colKey.join(delim)].push(record);
189
+ this.colTotals[colKey.join(delim)].isChangeable = true;
190
190
  }
191
191
  } else {
192
192
  this.allTotal.push(record);
@@ -340,7 +340,11 @@ let initDRPivotTable = function($, window, document) {
340
340
  };
341
341
  };
342
342
 
343
- largeToSmallSort = function(as, bs) {
343
+ largeToSmallSortByAbsolute = function (as, bs) {
344
+ return largeToSmallSort(as , bs, true);
345
+ }
346
+
347
+ largeToSmallSort = function(as, bs, is_abs = false) {
344
348
  var a, a1, b, b1, rd, rx, rz;
345
349
  rx = /(\d+)|(\D+)/g;
346
350
  rd = /\d/;
@@ -352,6 +356,11 @@ let initDRPivotTable = function($, window, document) {
352
356
  if (isNaN(bs)) {
353
357
  return 1;
354
358
  }
359
+
360
+ if (is_abs) {
361
+ return Math.abs(bs) - Math.abs(as);
362
+ }
363
+
355
364
  return bs - as;
356
365
  }
357
366
  a = String(as).toLowerCase();
@@ -2217,6 +2226,7 @@ let initDRPivotTable = function($, window, document) {
2217
2226
  $.pivotUtilities.getFormattedNumber = getFormattedNumber;
2218
2227
  $.pivotUtilities.sortDateStrings = sortDateStrings;
2219
2228
  $.pivotUtilities.largeToSmallSort = largeToSmallSort;
2229
+ $.pivotUtilities.largeToSmallSortByAbsolute = largeToSmallSortByAbsolute;
2220
2230
  $.pivotUtilities.getPivotDataModel = function(input, opts){ return new DRPivotData(input, opts); }
2221
2231
  $.pivotUtilities.getPivotTableFormula = function(rowData, opts, func, colFields, rowFields, aggregationDefaults, utils) {
2222
2232
  let totalStr = 'Grand Totals';
@@ -897,10 +897,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
897
897
  row_n_keys = pivotData.getRowKeys(),
898
898
  col_n_keys = pivotData.getColKeys();
899
899
 
900
- var num_cols = col_n_keys.length;
901
- var num_rows = row_n_keys.length;
902
- let averages = {};
903
-
904
900
  var has_delta = false;
905
901
  if (additionOptions && lodash.has(additionOptions, "delta_column.field") && additionOptions.delta_column.field == "series") {
906
902
  has_delta = true;
@@ -911,22 +907,22 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
911
907
 
912
908
  var i = 0;
913
909
  var variat_serias = null;
910
+ const n = col_n_keys.length;
911
+ const xSum = (1 + n) / 2 * n;
914
912
 
915
913
  lodash.forEach(row_n_keys, function (row_n_value) {
916
914
  var ob = {};
915
+ let ySum = 0;
916
+ let xySum = 0;
917
+ let squareXSum = 0;
917
918
  ob.data = [];
918
919
  if (row_n_value && row_n_value.length > 0)
919
920
  ob.name = row_n_value.join(highchartsRenderer.delimer);
920
921
 
921
- lodash.forEach(col_n_keys, function (col_n_value) {
922
+ lodash.forEach(col_n_keys, function (col_n_value, index) {
922
923
  var agg = pivotData.getAggregator(row_n_value, col_n_value);
923
924
  var val = agg.value();
924
925
 
925
- if (averages[col_n_value.toString()]) {
926
- averages[col_n_value.toString()].push(val);
927
- } else {
928
- averages[col_n_value.toString()] = [val];
929
- }
930
926
  if (isUniqueVals && agg.uniq)
931
927
  val = agg.uniq.join('<br>');
932
928
 
@@ -945,6 +941,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
945
941
  else
946
942
  val = 0;
947
943
  }
944
+
945
+ xySum += Number(val) * (index + 1);
946
+ ySum += Number(val);
947
+ squareXSum += (index + 1) * (index + 1);
948
948
  ob.data.push(val);
949
949
  });
950
950
 
@@ -958,6 +958,24 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
958
958
  }
959
959
 
960
960
  chart_series.push(ob);
961
+
962
+ if (opts.trendLine) {
963
+ const a = ((ySum * squareXSum) - (xSum * xySum)) / ((n * squareXSum) - (xSum * xSum));
964
+ const b = ((n * xySum) - (xSum* ySum)) / ((n * squareXSum) - (xSum * xSum));
965
+
966
+ const trendSeries = lodash.clone(chart_series[chart_series.length - 1]);
967
+ trendSeries.name = 'Trend Line (' + trendSeries.name + ')';
968
+ trendSeries.dashStyle = 'shortdot';
969
+ trendSeries.type = 'line';
970
+ trendSeries.data = trendSeries.data.map((el, index) => a + b * (index + 1));
971
+
972
+ if (colors && colors[i]) {
973
+ trendSeries.color = colors[i];
974
+ }
975
+
976
+ chart_series.push(trendSeries);
977
+ }
978
+
961
979
  i++;
962
980
  });
963
981
 
@@ -995,51 +1013,13 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
995
1013
  chart_series.push(newSeries);
996
1014
  }
997
1015
 
998
- if (opts.trendLine) {
999
- const trendSeries = lodash.clone(chart_series[chart_series.length - 1]);
1000
- trendSeries.name = 'Trend Line';
1001
- trendSeries.data = [];
1002
- const n = col_n_keys.length;
1003
- const xSum = (1 + n) / 2 * n;
1004
- let ySum = 0;
1005
- let xySum = 0;
1006
- let squareXSum = 0;
1007
-
1008
- col_n_keys.forEach((columnKey, x) => {
1009
- const y = averages[columnKey.toString()] = averages[columnKey.toString()].reduce((acc, el, index) => {
1010
- acc += Number(el);
1011
- if (index === averages[columnKey.toString()].length - 1) {
1012
- acc = acc / averages[columnKey.toString()].length;
1013
- }
1014
-
1015
- return acc;
1016
- }, 0);
1017
- xySum += y * (x+1);
1018
- ySum += y;
1019
- squareXSum += (x+1) * (x+1);
1020
- });
1021
-
1022
- const a = ((ySum * squareXSum) - (xSum * xySum)) / ((n * squareXSum) - (xSum * xSum));
1023
- const b = ((n * xySum) - (xSum* ySum)) / ((n * squareXSum) - (xSum * xSum));
1024
-
1025
- col_n_keys.forEach((columnKey, index) => {
1026
- trendSeries.data.push(a + b * (index + 1));
1027
- });
1028
-
1029
- trendSeries.type = 'line';
1030
-
1031
- chart_series.push(trendSeries);
1032
- }
1033
-
1034
1016
  return chart_series;
1035
1017
  };
1036
1018
 
1037
- highchartsRenderer.ptCreateColumnSeries = function (pivotData, colors, onlyNumbers, isUniqueVals, isNotDrilldown, additionOptions, opts, chartOptions) {
1019
+ highchartsRenderer.ptCreateColumnSeries = function (pivotData, colors, onlyNumbers, isUniqueVals, isNotDrilldown, additionOptions, opts, chartOptions, chartType) {
1038
1020
  var chart_series = [],
1039
1021
  row_n_keys = pivotData.getRowKeys(),
1040
1022
  col_n_keys = pivotData.getColKeys();
1041
- var num_cols = col_n_keys.length;
1042
- var num_rows = row_n_keys.length;
1043
1023
 
1044
1024
  var has_delta = false;
1045
1025
  if (additionOptions && lodash.has(additionOptions, "delta_column.field") && additionOptions.delta_column.field == "series") {
@@ -1051,9 +1031,13 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1051
1031
 
1052
1032
  var i = 0;
1053
1033
  var variat_serias = null;
1054
- let averages = {};
1034
+ const n = col_n_keys.length;
1035
+ const xSum = (1 + n) / 2 * n;
1055
1036
 
1056
1037
  lodash.forEach(row_n_keys, function (row_n_value) {
1038
+ let ySum = 0;
1039
+ let xySum = 0;
1040
+ let squareXSum = 0;
1057
1041
  var ob = {};
1058
1042
  ob.data = [];
1059
1043
  if (row_n_value && row_n_value.length > 0)
@@ -1066,14 +1050,9 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1066
1050
  style: highchartsRenderer.getDataLabelsStyle(additionOptions)
1067
1051
  }
1068
1052
 
1069
- lodash.forEach(col_n_keys, function (col_n_value) {
1053
+ lodash.forEach(col_n_keys, function (col_n_value, index) {
1070
1054
  var agg = pivotData.getAggregator(row_n_value, col_n_value);
1071
1055
  var val = agg.value();
1072
- if (averages[col_n_value.toString()]) {
1073
- averages[col_n_value.toString()].push(val);
1074
- } else {
1075
- averages[col_n_value.toString()] = [val];
1076
- }
1077
1056
 
1078
1057
  if (val != null) {
1079
1058
  if ($.isNumeric(val)) {
@@ -1105,6 +1084,9 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1105
1084
  if (!isNotDrilldown)
1106
1085
  tmoobj.drilldown = true;
1107
1086
 
1087
+ xySum += Number(val) * (index + 1);
1088
+ ySum += Number(val);
1089
+ squareXSum += (index + 1) * (index + 1);
1108
1090
  ob.data.push(tmoobj);
1109
1091
  });
1110
1092
 
@@ -1118,6 +1100,23 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1118
1100
  }
1119
1101
 
1120
1102
  chart_series.push(ob);
1103
+
1104
+ if (opts.trendLine) {
1105
+ const a = ((ySum * squareXSum) - (xSum * xySum)) / ((n * squareXSum) - (xSum * xSum));
1106
+ const b = ((n * xySum) - (xSum* ySum)) / ((n * squareXSum) - (xSum * xSum));
1107
+
1108
+ const trendSeries = lodash.clone(chart_series[chart_series.length - 1]);
1109
+ trendSeries.name = 'Trend Line (' + trendSeries.name + ')';
1110
+ trendSeries.dashStyle = 'shortdot';
1111
+ trendSeries.type = 'line';
1112
+ trendSeries.data = trendSeries.data.map((data, index) => ({name: data.name, y: a + b * (index + 1)}));
1113
+
1114
+ if (colors && colors[i]) {
1115
+ trendSeries.color = colors[i];
1116
+ }
1117
+
1118
+ chart_series.push(trendSeries);
1119
+ }
1121
1120
  i++;
1122
1121
  });
1123
1122
 
@@ -1133,7 +1132,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1133
1132
 
1134
1133
  let weights = { line: 2,spline: 3 ,area:-2, areaspline: -1, scatter:4, column: 1 };
1135
1134
 
1136
- if (opts.comboOptions && opts.comboOptions.seriesOptions.length) {
1135
+ if (opts.comboOptions && opts.comboOptions.seriesOptions.length && chartType.includes('combo')) {
1137
1136
  opts.comboOptions.seriesOptions.forEach(option => {
1138
1137
  chart_series.forEach(series => {
1139
1138
  if (option.series === series.name) {
@@ -1179,49 +1178,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1179
1178
  chart_series.push(totalSeries);
1180
1179
  }
1181
1180
 
1182
- if (opts.trendLine) {
1183
- const trendSeries = lodash.clone(chart_series[chart_series.length - 1]);
1184
- trendSeries.name = 'Trend Line';
1185
- trendSeries.data = [];
1186
- const n = col_n_keys.length;
1187
- const xSum = (1 + n) / 2 * n;
1188
- let ySum = 0;
1189
- let xySum = 0;
1190
- let squareXSum = 0;
1191
-
1192
- col_n_keys.forEach((columnKey, x) => {
1193
- const y = averages[columnKey.toString()] = averages[columnKey.toString()].reduce((acc, el, index) => {
1194
- acc += Number(el);
1195
- if (index === averages[columnKey.toString()].length - 1) {
1196
- acc = acc / averages[columnKey.toString()].length;
1197
- }
1198
-
1199
- return acc;
1200
- }, 0);
1201
- xySum += y * (x+1);
1202
- ySum += y;
1203
- squareXSum += (x+1) * (x+1);
1204
- });
1205
-
1206
- const a = ((ySum * squareXSum) - (xSum * xySum)) / ((n * squareXSum) - (xSum * xSum));
1207
- const b = ((n * xySum) - (xSum* ySum)) / ((n * squareXSum) - (xSum * xSum));
1208
-
1209
- col_n_keys.forEach((columnKey, index) => {
1210
- let key = columnKey;
1211
- if (lodash.isArray(columnKey)) {
1212
- key = columnKey[0];
1213
- }
1214
-
1215
- trendSeries.data.push({
1216
- name: lodash.unescape(key), y: a + b * (index + 1)
1217
- });
1218
- });
1219
-
1220
- trendSeries.type = 'line';
1221
-
1222
- chart_series.push(trendSeries);
1223
- }
1224
-
1225
1181
  chart_series.sort((a,b) => {
1226
1182
  return (weights[a.type] || 0) > (weights[b.type] || 0) ? 1 : (weights[a.type] || 0) < (weights[b.type] || 0) ? -1 : 0
1227
1183
  });
@@ -1263,7 +1219,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1263
1219
  };
1264
1220
  } else if (delta_column_options.chart == 'column' || delta_column_options.chart == 'combo') {
1265
1221
  series.type = 'column';
1266
- } else {
1222
+ } else if (delta_column_options.chart == 'spline') {
1267
1223
  series.type = 'spline';
1268
1224
  series.lineWidth = 0;
1269
1225
  series.lineColor = varianceColor;
@@ -1303,6 +1259,16 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1303
1259
  }
1304
1260
  };
1305
1261
  }
1262
+ else if (delta_column_options.chart == 'area') {
1263
+ series.color = varianceColor;
1264
+ series.type = 'area'
1265
+ } else if (delta_column_options.chart == 'areaspline') {
1266
+ series.color = varianceColor;
1267
+ series.type = 'areaspline'
1268
+ } else if (delta_column_options.chart == 'scatter-chart') {
1269
+ series.color = varianceColor;
1270
+ series.type = 'scatter-chart'
1271
+ }
1306
1272
  return series;
1307
1273
  }
1308
1274
 
@@ -1412,7 +1378,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1412
1378
  }
1413
1379
 
1414
1380
  highchartsRenderer.addSecondYAxis = function (pivotData, chartOptions, additionOptions, opts) {
1415
- const varianceColor = additionOptions.delta_column.color || highchartsRenderer.variance_color || Highcharts.getOptions().colors[7];
1381
+ const varianceColor = (additionOptions && additionOptions.delta_column.color) || (highchartsRenderer && highchartsRenderer.variance_color) || Highcharts.getOptions().colors[7];
1416
1382
  let labels_formatter = opts.comboOptions.secondaryAxisSettings.is_percentage ?
1417
1383
  highchartsRenderer.persantageValueLabelsFormatter(pivotData, opts) :
1418
1384
  highchartsRenderer.defaultValueLabelsFormatter(pivotData, opts);
@@ -2394,7 +2360,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
2394
2360
  return highchartsRenderer.ptCreateElementAndDraw(chartOptions, opts);
2395
2361
  };
2396
2362
 
2397
- highchartsRenderer.ptRenderColumn = function (pivotData, opts, drilldownFunc) {
2363
+ highchartsRenderer.ptRenderColumn = function (pivotData, opts, drilldownFunc, chartType) {
2398
2364
  var chartOptions = {};
2399
2365
  var rowAttrs = pivotData.rowAttrs;
2400
2366
  var colAttrs = pivotData.colAttrs;
@@ -2462,7 +2428,13 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
2462
2428
  highchartsRenderer.handleGridLines(additionOptions, chartOptions);
2463
2429
 
2464
2430
  var isNotDrilldown = !(colAttrs && colAttrs.length > 1);
2465
- chartOptions.series = highchartsRenderer.ptCreateColumnSeries(pivotData, null, null, null, isNotDrilldown, additionOptions, opts, chartOptions);
2431
+ if (lodash.get(opts, 'paletteOptions.widgetPalette', null)) {
2432
+ const mc_palette = lodash.find(lodash.get(opts.paletteOptions, 'monochromePalettes', []), { selected: true });
2433
+ chartOptions.colors = mc_palette ? mc_palette.colors : opts.paletteOptions.widgetPalette;
2434
+ } else if (lodash.get(opts, 'paletteOptions.dashboardPalette.colors', null)) {
2435
+ chartOptions.colors = opts.paletteOptions.dashboardPalette.colors;
2436
+ }
2437
+ chartOptions.series = highchartsRenderer.ptCreateColumnSeries(pivotData, chartOptions.colors, null, null, isNotDrilldown, additionOptions, opts, chartOptions, chartType);
2466
2438
  chartOptions = highchartsRenderer.prepareAxisX(chartOptions, additionOptions, pivotData.getColKeys());
2467
2439
  chartOptions.plotOptions = {
2468
2440
  column: {
@@ -2499,7 +2471,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
2499
2471
  return highchartsRenderer.ptCreateElementAndDraw(chartOptions, opts);
2500
2472
  };
2501
2473
 
2502
- highchartsRenderer.ptRenderStackedColumn = function (pivotData, opts, drilldownFunc) {
2474
+ highchartsRenderer.ptRenderStackedColumn = function (pivotData, opts, drilldownFunc, chartType) {
2503
2475
  var chartOptions = {};
2504
2476
  var rowAttrs = pivotData.rowAttrs;
2505
2477
  var additionOptions = opts.chartOptions ? opts.chartOptions : highchartsRenderer.getDefaultValueForChart('column-chart-stacked');
@@ -2630,7 +2602,13 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
2630
2602
  };
2631
2603
  //chartOptions.xAxis = { categories: pivotData.getColKeys() };
2632
2604
  chartOptions = highchartsRenderer.prepareAxisX(chartOptions, additionOptions, pivotData.getColKeys());
2633
- chartOptions.series = highchartsRenderer.ptCreateColumnSeries(pivotData, null, null, true, true, null, opts, chartOptions);
2605
+ if (lodash.get(opts, 'paletteOptions.widgetPalette', null)) {
2606
+ const mc_palette = lodash.find(lodash.get(opts.paletteOptions, 'monochromePalettes', []), { selected: true });
2607
+ chartOptions.colors = mc_palette ? mc_palette.colors : opts.paletteOptions.widgetPalette;
2608
+ } else if (lodash.get(opts, 'paletteOptions.dashboardPalette.colors', null)) {
2609
+ chartOptions.colors = opts.paletteOptions.dashboardPalette.colors;
2610
+ }
2611
+ chartOptions.series = highchartsRenderer.ptCreateColumnSeries(pivotData, chartOptions.colors, null, true, true, null, opts, chartOptions, chartType);
2634
2612
  //chartOptions.drilldown = {}
2635
2613
 
2636
2614
  highchartsRenderer.handleGridLines(additionOptions, chartOptions)
@@ -4002,11 +3980,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4002
3980
  pivotData.sorters = new_sorting_function;
4003
3981
  }
4004
3982
 
4005
- if (totalFilters && totalFilters.filter_options) {
4006
- result = highchartsRenderer.generateFilteredResult(totalFilters, optsFiltered, rowData, opts, pivotData);
4007
- } else {
4008
- result = opts.renderer(pivotData, opts.rendererOptions);
4009
- }
3983
+ result = opts.renderer(pivotData, opts.rendererOptions);
4010
3984
  } catch (_error) {
4011
3985
  e = _error;
4012
3986
  if (typeof console !== "undefined" && console !== null) {
@@ -5032,6 +5006,12 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
5032
5006
  value_name: 'remove_underscores',
5033
5007
  default_value: true
5034
5008
  },
5009
+ {
5010
+ element_type: 'checkbox',
5011
+ element_label: 'Use big data table',
5012
+ value_name: 'use_handsOnTable',
5013
+ default_value: false
5014
+ },
5035
5015
  {
5036
5016
  element_type: 'checkbox',
5037
5017
  element_label: 'Use new table design',
@@ -5588,12 +5568,14 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
5588
5568
  element_type: 'checkbox',
5589
5569
  element_label: 'Sort by variance',
5590
5570
  value_name: 'sort_by_variance',
5591
- default_value: false
5571
+ default_value: false,
5572
+ hidden: true
5592
5573
  }, {
5593
5574
  element_type: 'checkbox',
5594
5575
  element_label: 'Sort by absolute variance',
5595
5576
  value_name: 'sort_by_absolute_variance',
5596
- default_value: false
5577
+ default_value: false,
5578
+ hidden: true
5597
5579
  }]
5598
5580
  },
5599
5581
  'delta_column_for_drill_down': {
@@ -5818,12 +5800,14 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
5818
5800
  element_type: 'checkbox',
5819
5801
  element_label: 'Sort by variance',
5820
5802
  value_name: 'sort_by_variance',
5821
- default_value: false
5803
+ default_value: false,
5804
+ hidden: true
5822
5805
  }, {
5823
5806
  element_type: 'checkbox',
5824
5807
  element_label: 'Sort by absolute variance',
5825
5808
  value_name: 'sort_by_absolute_variance',
5826
- default_value: false
5809
+ default_value: false,
5810
+ hidden: true
5827
5811
  }, {
5828
5812
  element_type: 'checkbox',
5829
5813
  element_label: 'Filter zero values',
@@ -5901,7 +5885,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
5901
5885
  },
5902
5886
  'combo-column-chart': {
5903
5887
  name: 'Column Combo Chart ',
5904
- label: 'Column Combo Chart ',
5888
+ label: 'Column Chart',
5905
5889
  title: 'Allows for multiple chart display formats in one widget',
5906
5890
  description: 'For example, Revenue and Cost of goods sold as clomuns, and Gross margin as a line',
5907
5891
  axisName: 'X - Axis',
@@ -5912,7 +5896,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
5912
5896
  },
5913
5897
  'combo-stacked-chart': {
5914
5898
  name: 'Stacked Column Combo Chart ',
5915
- label: 'Stacked Column Combo Chart ',
5899
+ label: 'Stacked Column',
5916
5900
  title: 'Allows for multiple chart display formats in one widget.',
5917
5901
  description: 'For example, different department stacked clomuns, and average as a line.',
5918
5902
  axisName: 'X - Axis',
@@ -7103,6 +7087,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7103
7087
  };
7104
7088
 
7105
7089
  highchartsRenderer.setNewFieldNames = function (res) {
7090
+ if (useTotalsCalculation) {
7091
+ return res;
7092
+ }
7093
+
7106
7094
  if (res && res[0] && res[0]['DR_Values']) {
7107
7095
  lodash.forEach(res, function (item) {
7108
7096
  item['DR_Values'] = highchartsRenderer.getFieldName(item['DR_Values']);
@@ -7184,7 +7172,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7184
7172
  "name": field.name,
7185
7173
  "type": field.type,
7186
7174
  "values": [],
7187
- "sorting": field.sorting
7175
+ "sorting": field.sorting,
7188
7176
  });
7189
7177
  }
7190
7178
  } else if (field.sorting && field.sorting.type == "CustomOrder" && field.sorting.values) {
@@ -7269,6 +7257,9 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7269
7257
  if (field.sorting && field.sorting.type == "DateString") {
7270
7258
  return $.pivotUtilities.sortDateStrings(field.sorting.month_order);
7271
7259
  } else if (field.sorting && field.sorting.type == "largestToSmallest") {
7260
+ if (field.sorting.is_absolute)
7261
+ return $.pivotUtilities.largeToSmallSortByAbsolute;
7262
+
7272
7263
  return $.pivotUtilities.largeToSmallSort;
7273
7264
  } else {
7274
7265
  return $.pivotUtilities.sortAs(field.values);