@datarailsshared/dr_renderer 1.5.150 → 1.5.157

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.5.150",
3
+ "version": "1.5.157",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -90,10 +90,15 @@ function DrDonutChart(highchartsRenderer, pivotData, opts, drilldownFunc, disabl
90
90
  const series = chart.series[0];
91
91
 
92
92
  const aggTotal = pivotData.getAggregator([], []);
93
+ const hasAggValue = aggTotal && typeof aggTotal.value === 'function';
94
+ const hasAggFormat = aggTotal && typeof aggTotal.format === 'function';
95
+ const totalValue = hasAggValue ? aggTotal.value() : series.total;
93
96
  const formattedValue =
94
97
  additionOptions && additionOptions.customTotalValueFormatFn
95
- ? additionOptions.customTotalValueFormatFn(series.total)
96
- : aggTotal.format(series.total, true);
98
+ ? additionOptions.customTotalValueFormatFn(totalValue)
99
+ : hasAggFormat
100
+ ? aggTotal.format(totalValue, true)
101
+ : totalValue;
97
102
 
98
103
  if (totalLabel) {
99
104
  totalLabel.destroy();