@datarailsshared/dr_renderer 1.2.68 → 1.2.72
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 +1 -1
- package/src/dr_pivottable.js +1 -1
- package/src/highcharts_renderer.js +10 -2
package/package.json
CHANGED
package/src/dr_pivottable.js
CHANGED
|
@@ -146,7 +146,7 @@ let initDRPivotTable = function($, window, document) {
|
|
|
146
146
|
DRPivotData.prototype.processRecord = function(record, useTotalsCalculation) {
|
|
147
147
|
if (useTotalsCalculation) {
|
|
148
148
|
if (!this.notFirst) {
|
|
149
|
-
this.keysLength = _.keys(record).length - 1;
|
|
149
|
+
this.keysLength = _.filter(_.keys(record), key => !['data_types', 'formats', 'values_formats'].includes(key)).length - 1;
|
|
150
150
|
this.notFirst = true;
|
|
151
151
|
}
|
|
152
152
|
let getRowAggregator = (function(_this) {
|
|
@@ -917,6 +917,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
917
917
|
const n = col_n_keys.length;
|
|
918
918
|
const xSum = (1 + n) / 2 * n;
|
|
919
919
|
const trendSerieses = [];
|
|
920
|
+
const othersName = lodash.get(opts, "total_value_options.filter_options.filteredOutFieldName") || 'Others';
|
|
920
921
|
|
|
921
922
|
lodash.forEach(row_n_keys, function (row_n_value) {
|
|
922
923
|
var ob = {};
|
|
@@ -925,7 +926,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
925
926
|
let squareXSum = 0;
|
|
926
927
|
ob.data = [];
|
|
927
928
|
if (row_n_value && row_n_value.length > 0) {
|
|
928
|
-
let othersName = lodash.get(opts, "total_value_options.filter_options.filteredOutFieldName") || 'Others';
|
|
929
929
|
ob.name = row_n_value.join(highchartsRenderer.delimer).replace('DR_Others', othersName);
|
|
930
930
|
}
|
|
931
931
|
|
|
@@ -933,6 +933,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
933
933
|
var agg = pivotData.getAggregator(row_n_value, col_n_value);
|
|
934
934
|
var val = agg.value();
|
|
935
935
|
|
|
936
|
+
if (col_n_value[0] === 'DR_Others') {
|
|
937
|
+
col_n_value[0] = othersName;
|
|
938
|
+
}
|
|
939
|
+
|
|
936
940
|
if (isUniqueVals && agg.uniq)
|
|
937
941
|
val = agg.uniq.join('<br>');
|
|
938
942
|
|
|
@@ -1059,6 +1063,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1059
1063
|
const n = col_n_keys.length;
|
|
1060
1064
|
const xSum = (1 + n) / 2 * n;
|
|
1061
1065
|
const trendSerieses = [];
|
|
1066
|
+
const othersName = lodash.get(opts, "total_value_options.filter_options.filteredOutFieldName") || 'Others';
|
|
1062
1067
|
|
|
1063
1068
|
lodash.forEach(row_n_keys, function (row_n_value) {
|
|
1064
1069
|
let ySum = 0;
|
|
@@ -1067,7 +1072,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1067
1072
|
var ob = {};
|
|
1068
1073
|
ob.data = [];
|
|
1069
1074
|
if (row_n_value && row_n_value.length > 0) {
|
|
1070
|
-
let othersName = lodash.get(opts, "total_value_options.filter_options.filteredOutFieldName") || 'Others';
|
|
1071
1075
|
ob.name = lodash.unescape(row_n_value.join(highchartsRenderer.delimer).replace('DR_Others', othersName));
|
|
1072
1076
|
}
|
|
1073
1077
|
|
|
@@ -1105,6 +1109,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1105
1109
|
}
|
|
1106
1110
|
tmoobj.name = lodash.unescape(key);
|
|
1107
1111
|
|
|
1112
|
+
if (tmoobj.name) {
|
|
1113
|
+
tmoobj.name = tmoobj.name.replace('DR_Others', othersName);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1108
1116
|
if (lodash.isEmpty(String(tmoobj.name))) {
|
|
1109
1117
|
tmoobj.name = "[blank]";
|
|
1110
1118
|
}
|