@datarailsshared/dr_renderer 1.2.266 → 1.2.268

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.266",
3
+ "version": "1.2.268",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -493,6 +493,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
493
493
  if (!cols && is_drill_down_pie) {
494
494
  cols = this.point.name;
495
495
  }
496
+ const row_n_keys = pivotData.getRowKeys();
496
497
 
497
498
  if (!lodash.isArray(cols)) {
498
499
  cols = [cols];
@@ -522,8 +523,20 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
522
523
  }
523
524
 
524
525
  if (labelOptions.show_out_of_data_series) {
525
- const dataSeriesTotal = pivotData.getAggregator(rows, []).value();
526
- const outOfDataSeriesPercentages = dataSeriesTotal ? Math.round(value / dataSeriesTotal * 100) + '%' : '';
526
+ let dataSeriesTotal;
527
+ let outOfDataSeriesPercentages;
528
+
529
+ if (this.series.options.className === SERIES_CLASSNAMES.WATERFALL_BREAKDOWN) {
530
+ dataSeriesTotal = row_n_keys.reduce((a, d) => {
531
+ return a + pivotData.getAggregator(d, []).value();
532
+ }, 0);
533
+ const axisTotal = pivotData.getAggregator([], cols).value();
534
+ outOfDataSeriesPercentages = !axisTotal ? Math.round(value / dataSeriesTotal * 100) + '%' : '';
535
+ } else {
536
+ dataSeriesTotal = pivotData.getAggregator(rows, []).value();
537
+ outOfDataSeriesPercentages = dataSeriesTotal ? Math.round(value / dataSeriesTotal * 100) + '%' : '';
538
+ }
539
+
527
540
  outOfDataSeriesPercentages && percentageArray.push(outOfDataSeriesPercentages);
528
541
  }
529
542