@datarailsshared/dr_renderer 1.2.127 → 1.2.128
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/highcharts_renderer.js +18 -3
package/package.json
CHANGED
|
@@ -422,6 +422,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
422
422
|
}
|
|
423
423
|
|
|
424
424
|
const labelOptions = lodash.get(opts.chartOptions, 'label') || lodash.get(opts.chartOptions, 'label_pie');
|
|
425
|
+
const othersName = opts.total_value_options ?
|
|
426
|
+
lodash.get(opts, "total_value_options.filter_options.filteredOutFieldName") || 'Others' :
|
|
427
|
+
undefined;
|
|
428
|
+
var drOthersInColumn = lodash.find(pivotData.getColKeys(), keys => keys.length && (keys.includes('DR_Others') || keys.includes(othersName)));
|
|
425
429
|
|
|
426
430
|
var func = function () {
|
|
427
431
|
var value = parseFloat(this.y);
|
|
@@ -447,8 +451,19 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
447
451
|
cols = this.point.name;
|
|
448
452
|
}
|
|
449
453
|
|
|
450
|
-
|
|
451
|
-
|
|
454
|
+
if (drOthersInColumn) {
|
|
455
|
+
if (!lodash.isArray(cols) && othersName === cols) {
|
|
456
|
+
cols = ['DR_Others'];
|
|
457
|
+
} else if (lodash.isArray(cols)) {
|
|
458
|
+
var index = cols.indexOf(othersName);
|
|
459
|
+
|
|
460
|
+
if (index !== -1) {
|
|
461
|
+
cols[index] = 'DR_Others';
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
if (!lodash.isArray(cols)) {
|
|
452
467
|
cols = [cols];
|
|
453
468
|
}
|
|
454
469
|
|
|
@@ -1109,7 +1124,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1109
1124
|
ob.dataLabels = {
|
|
1110
1125
|
allowOverlap: additionOptions && additionOptions.label ? additionOptions.label.overlap : false,
|
|
1111
1126
|
enabled: additionOptions && additionOptions.label ? additionOptions.label.show : true,
|
|
1112
|
-
formatter: highchartsRenderer.defaultDataLabelFormatter(pivotData, {'chartOptions': additionOptions}),
|
|
1127
|
+
formatter: highchartsRenderer.defaultDataLabelFormatter(pivotData, {'chartOptions': additionOptions, total_value_options: opts.total_value_options}),
|
|
1113
1128
|
style: highchartsRenderer.getDataLabelsStyle(additionOptions)
|
|
1114
1129
|
}
|
|
1115
1130
|
|