@datarailsshared/dr_renderer 1.2.213-rocket → 1.2.215-dragons

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.213-rocket",
3
+ "version": "1.2.215-dragons",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -2421,8 +2421,14 @@ let initDRPivotTable = function($, window, document) {
2421
2421
  if (colAttrs.length > 0 && colKeys.length > 0) {
2422
2422
  colHeaders = processKeys(colKeys, "pvtColLabel", 'cols', colAttrs);
2423
2423
  }
2424
- var tableClasses = useNewUx && opts.chartOptions.table_options.use_new_table_design ? 'pvtTable newPvtTable' : 'pvtTable';
2425
- result = createElement("table", tableClasses , null, {
2424
+ var tableClasses = ['pvtTable'];
2425
+ if (opts.chartOptions.table_options.use_new_table_design) {
2426
+ tableClasses.push('newPvtTable');
2427
+ }
2428
+ if (!pivotData.aggregator().uniq) {
2429
+ tableClasses.push('numbers-to-right');
2430
+ }
2431
+ result = createElement("table", tableClasses.join(' ') , null, {
2426
2432
  style: "display: none;"
2427
2433
  });
2428
2434
 
@@ -1,5 +1,6 @@
1
1
  const SERIES_CLASSNAMES = {
2
2
  WATERFALL_BREAKDOWN: 'waterfallBreakdown',
3
+ WATERFALL_WALKTHROUGH: 'waterfallWalkthrough',
3
4
  TOTAL_SERIES: 'totalSeries',
4
5
  TREND_SERIES: 'trendSeries',
5
6
  };
@@ -25,6 +26,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
25
26
  const textColor = "#151a41";
26
27
  const chartLabelColor = "#cfd7dd";
27
28
  const HIGHCHARTS_FONT_FAMILY = 'Poppins';
29
+ let firstBarColor = null;
28
30
 
29
31
  if(!Highcharts){
30
32
  Highcharts = {
@@ -82,11 +84,16 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
82
84
  KPI_WIDGET: 'kpi-widget',
83
85
  TEXT_WIDGET: 'text-widget',
84
86
  WATERFALL_BREAKDOWN: 'waterfall-chart-breakdown',
87
+ WATERFALL_WALKTHROUGH: 'waterfall-chart-walkthrough',
85
88
  PUBLISHED_ITEM: 'published_item',
86
89
  RICH_TEXT: 'rich_text',
87
90
  EXCEL_VIEWER: 'excel_viewer',
88
91
  };
89
92
 
93
+ highchartsRenderer.VIRTUAL_FIELDS = {
94
+ WATERFALL_VARIANCE: 'DR_WATERFALL_BREAKDOWN_VARIANCE',
95
+ };
96
+
90
97
  highchartsRenderer.highcharts_theme = {
91
98
  "colors": highchartsRenderer.defaults_colors,
92
99
  "chart": {
@@ -462,7 +469,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
462
469
  highchartsRenderer.getOthersName(opts) :
463
470
  undefined;
464
471
  var drOthersInColumn = lodash.find(
465
- pivotData.getColKeys(),
472
+ pivotData.getColKeys(),
466
473
  keys => keys.length && (lodash.includes(keys, 'DR_Others') || lodash.includes(keys, othersName))
467
474
  );
468
475
 
@@ -482,7 +489,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
482
489
  rows = [];
483
490
  }
484
491
 
485
- var cols = this.key;
492
+ var cols = lodash.get(this, 'point.options.colsForTotal') || this.key;
486
493
  if (typeof (cols) == 'object' && cols.name) {
487
494
  cols = cols.name;
488
495
  }
@@ -490,7 +497,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
490
497
  if (!cols && is_drill_down_pie) {
491
498
  cols = this.point.name;
492
499
  }
493
-
500
+
494
501
  if (drOthersInColumn) {
495
502
  if (!lodash.isArray(cols) && othersName === cols) {
496
503
  cols = ['DR_Others'];
@@ -628,7 +635,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
628
635
  || this.series.options.className === 'trendSeries') {
629
636
  rows = [];
630
637
  }
631
- var cols = this.key;
638
+
639
+ var cols = lodash.get(this, 'point.options.colsForTotal') || this.key;
632
640
  if (!cols && is_drill_down_pie) {
633
641
  cols = this.name;
634
642
  }
@@ -651,7 +659,9 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
651
659
  rows = temp;
652
660
  }
653
661
 
654
- var category_text = `<span style="font-weight: bold;">${ cols }${ isWaterfallBreakdown ? ': ' : ' ' }</span>`;
662
+ var category_text = `<span style="font-weight: bold;">
663
+ ${ lodash.get(this, 'point.options.colsForTotal') ? cols[0] : cols } ${ isWaterfallBreakdown ? ': ' : ' ' }
664
+ </span>`;
655
665
  if (this.category) {
656
666
  category_text = '';
657
667
  }
@@ -668,7 +678,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
668
678
  const modifiedRowsAndCols = highchartsRenderer.transformRowsAndColsForBreakdown(rows, cols, this.point, opts);
669
679
  rows = modifiedRowsAndCols.rows;
670
680
  cols = modifiedRowsAndCols.cols;
671
- }
681
+ }
672
682
 
673
683
  var aggr = pivotData.getAggregator(rows, cols);
674
684
 
@@ -1339,15 +1349,11 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1339
1349
  return chart_series;
1340
1350
  }
1341
1351
 
1342
- highchartsRenderer.ptCreateWaterfallBreakdownSeries = function (pivotData, onlyNumbers, additionOptions, opts) {
1352
+ highchartsRenderer.ptCreateWaterfallBreakdownSeries = function (pivotData, additionOptions, opts) {
1343
1353
  const colorOptions = opts.breakdown_options.colors;
1344
- var chart_series = [],
1345
- row_n_keys = pivotData.getRowKeys(),
1346
- col_n_keys = pivotData.getColKeys();
1347
-
1348
- if (row_n_keys.length === 0) {
1349
- row_n_keys.push([]);
1350
- }
1354
+ const chart_series = [];
1355
+ const row_n_keys = pivotData.getRowKeys();
1356
+ const col_n_keys = pivotData.getColKeys();
1351
1357
 
1352
1358
  let resultObject = {
1353
1359
  data: [],
@@ -1363,60 +1369,47 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1363
1369
  };
1364
1370
  resultObject = highchartsRenderer.getDataLabelsOptions(additionOptions, resultObject);
1365
1371
 
1366
- const breakdownValues = [];
1367
1372
  lodash.forEach(col_n_keys, function(col_n_value, col_index) {
1368
- breakdownValues.push([]);
1369
- lodash.forEach(row_n_keys, function (row_n_value, row_index) {
1370
- var agg = pivotData.getAggregator(row_n_value, col_n_value);
1371
- var val = agg.value();
1372
-
1373
- if (val != null && $.isNumeric(val)) {
1374
- val = parseFloat(val);
1375
- } else if (onlyNumbers) {
1376
- val = NaN;
1377
- } else {
1378
- val = 0;
1379
- }
1380
1373
 
1381
- breakdownValues[col_index][row_index] = val;
1374
+ const totalColumnValue = pivotData.getAggregator([], col_n_value).value();
1375
+ resultObject.data.push({
1376
+ y: totalColumnValue,
1377
+ name: lodash.unescape(col_n_value).replace('DR_Others', highchartsRenderer.getOthersName(opts)),
1378
+ isSum: !!col_index,
1379
+ isTotal: true,
1380
+ color: colorOptions.total,
1381
+ });
1382
1382
 
1383
- if (col_index) {
1384
- const value = val - breakdownValues[col_index - 1][row_index];
1383
+ if (col_index !== col_n_keys.length - 1) {
1384
+ lodash.forEach(row_n_keys, function (row_n_value) {
1385
+ const agg = pivotData.getAggregator(row_n_value, col_n_value);
1386
+ let val = agg.value();
1385
1387
 
1386
- if (value) {
1387
- var tmoobj = {};
1388
- var key = row_n_value;
1389
- if (lodash.isArray(row_n_value)) {
1390
- key = row_n_value[0];
1391
- }
1388
+ val = $.isNumeric(val) ? parseFloat(val) : 0;
1389
+ if (val) {
1390
+ const tmoobj = {};
1391
+ const key = lodash.isArray(row_n_value) ? row_n_value[0] : row_n_value;
1392
1392
  tmoobj.name = lodash.unescape(key);
1393
-
1393
+
1394
1394
  if (tmoobj.name) {
1395
1395
  tmoobj.name = tmoobj.name.replace('DR_Others', highchartsRenderer.getOthersName(opts));
1396
1396
  }
1397
-
1397
+
1398
1398
  if (lodash.isEmpty(String(tmoobj.name))) {
1399
1399
  tmoobj.name = lodash.unescape(col_n_value);
1400
1400
  tmoobj.visible = false;
1401
1401
  }
1402
- tmoobj.y = value;
1402
+
1403
+ tmoobj.y = val;
1403
1404
  tmoobj.colKeys = [lodash.unescape(col_n_keys[col_index - 1]), lodash.unescape(col_n_value)];
1404
1405
  resultObject.data.push(tmoobj);
1405
1406
  }
1406
- }
1407
- });
1408
1407
 
1409
- resultObject.data.push({
1410
- y: pivotData.colTotals[col_n_value].sum,
1411
- name: lodash.unescape(col_n_value).replace('DR_Others', highchartsRenderer.getOthersName(opts)),
1412
- isSum: !!col_index,
1413
- isTotal: true,
1414
- color: colorOptions.total,
1415
- });
1408
+ });
1409
+ }
1416
1410
  });
1417
1411
 
1418
1412
  chart_series.push(resultObject);
1419
-
1420
1413
  opts.chart_series = [];
1421
1414
  if (!lodash.isEqual(row_n_keys, EMPTY_ROW_N_KEYS)) {
1422
1415
  chart_series.forEach(series => {
@@ -1427,6 +1420,85 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1427
1420
  return chart_series;
1428
1421
  }
1429
1422
 
1423
+ highchartsRenderer.ptCreateWaterfallWalkthroughSeries = function (pivotData, onlyNumbers, additionOptions, opts) {
1424
+ const waterfallOptions = opts.walkthrough_options;
1425
+ const chart_series = [];
1426
+ let resultObject = {
1427
+ data: [],
1428
+ dataLabels: {
1429
+ allowOverlap: additionOptions && additionOptions.label ? additionOptions.label.overlap : false,
1430
+ enabled: additionOptions && additionOptions.label ? additionOptions.label.show : true,
1431
+ formatter: highchartsRenderer.defaultDataLabelFormatter(pivotData, {'chartOptions': additionOptions, total_value_options: opts.total_value_options}),
1432
+ style: highchartsRenderer.getDataLabelsStyle(additionOptions),
1433
+ },
1434
+ upColor: waterfallOptions.colors.increase,
1435
+ color: waterfallOptions.colors.decrease,
1436
+ className: SERIES_CLASSNAMES.WATERFALL_WALKTHROUGH
1437
+ };
1438
+ resultObject = highchartsRenderer.getDataLabelsOptions(additionOptions, resultObject);
1439
+ lodash.forEach(waterfallOptions.values.walkthrough, function(value, index) {
1440
+
1441
+ let keys = [];
1442
+ if (value.trend === 'total') {
1443
+ keys = ['Total'];
1444
+ } else {
1445
+ _.forEach(value.key, (item) => {
1446
+ const findKeyByValue = Object.keys(pivotData.dateValuesDictionary || {}).find(key => pivotData.dateValuesDictionary[key] === item);
1447
+ keys.push(findKeyByValue ? findKeyByValue : item);
1448
+ })
1449
+ }
1450
+
1451
+ const agg = pivotData.getAggregator([], keys);
1452
+ let val = agg.value();
1453
+
1454
+ if (val != null && $.isNumeric(val)) {
1455
+ val = parseFloat(val);
1456
+ } else if (onlyNumbers) {
1457
+ val = NaN;
1458
+ } else {
1459
+ val = 0;
1460
+ }
1461
+
1462
+ const name = value.trend === 'total' ? value.formattedKey || value.key[0] : keys.join(highchartsRenderer.delimer);
1463
+ let color = '';
1464
+ if (value.trend !== 'total') {
1465
+ if (index === 0 && !firstBarColor) {
1466
+ color = waterfallOptions.colors.total;
1467
+ firstBarColor = waterfallOptions.colors.total;
1468
+ } else {
1469
+ color = value.color
1470
+ }
1471
+ } else {
1472
+ color = waterfallOptions.colors.total;
1473
+ }
1474
+
1475
+ resultObject.data.push({
1476
+ y: val,
1477
+ name: lodash.unescape(name).replace('DR_Others', highchartsRenderer.getOthersName(opts)),
1478
+ isSum: value.trend === 'total',
1479
+ isTotal: value.trend === 'total',
1480
+ color,
1481
+ colsForTotal: value.trend === 'total' ? keys : null,
1482
+ });
1483
+ });
1484
+ chart_series.push(resultObject);
1485
+ chart_series.push(
1486
+ {
1487
+ name: 'Increase',
1488
+ visible: false,
1489
+ color: waterfallOptions.colors.increase
1490
+ });
1491
+
1492
+ chart_series.push(
1493
+ {
1494
+ name: 'Decrease',
1495
+ visible: false,
1496
+ color: waterfallOptions.colors.decrease
1497
+ });
1498
+
1499
+ return chart_series;
1500
+ }
1501
+
1430
1502
  highchartsRenderer.setChartTypeBySeriesType = function (type, series) {
1431
1503
  const types = {
1432
1504
  'line-chart': 'line',
@@ -1630,7 +1702,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1630
1702
  highchartsRenderer.getDataLabelsStylesForDrillDown = function(additionOptions) {
1631
1703
  let result = highchartsRenderer.getDataLabelsOptions(additionOptions, { dataLabels: {} });
1632
1704
 
1633
- if (!result.dataLabels) return {};
1705
+ if (!result.dataLabels) return {};
1634
1706
  return {
1635
1707
  activeDataLabelStyle: {
1636
1708
  color: result.dataLabels.color,
@@ -3186,10 +3258,12 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
3186
3258
 
3187
3259
  highchartsRenderer.ptRenderWaterfallBreakdown = function (pivotData, opts, drilldownFunc, chartType) {
3188
3260
  let chartOptions = {};
3189
- const additionOptions = opts.chartOptions
3261
+ const additionOptions = opts.chartOptions
3190
3262
  ? opts.chartOptions
3191
3263
  : highchartsRenderer.getDefaultValueForChart(highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN);
3192
3264
 
3265
+ pivotData.colKeys = lodash.map(lodash.keys(pivotData.colTotals), key => [key]);
3266
+
3193
3267
  chartOptions.chart = {
3194
3268
  type: 'waterfall',
3195
3269
  zoomType: additionOptions && additionOptions.chart && additionOptions.chart.zoom_type ? additionOptions.chart.zoom_type : 'None',
@@ -3240,7 +3314,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
3240
3314
  chartOptions.colors = opts.paletteOptions.dashboardPalette.colors;
3241
3315
  }
3242
3316
  chartOptions.series = highchartsRenderer
3243
- .ptCreateWaterfallBreakdownSeries(pivotData, null, additionOptions, opts);
3317
+ .ptCreateWaterfallBreakdownSeries(pivotData, additionOptions, opts);
3244
3318
 
3245
3319
  chartOptions = highchartsRenderer.prepareAxisX(chartOptions, additionOptions, pivotData.getColKeys());
3246
3320
  chartOptions.plotOptions = {
@@ -3283,6 +3357,122 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
3283
3357
  return highchartsRenderer.ptCreateElementAndDraw(chartOptions, opts);
3284
3358
  };
3285
3359
 
3360
+ highchartsRenderer.ptRenderWaterfallWalkthrough = function (pivotData, opts) {
3361
+ let chartOptions = {};
3362
+ const waterfallOptions = opts?.walkthrough_options;
3363
+ const additionOptions = opts.chartOptions
3364
+ ? opts.chartOptions
3365
+ : highchartsRenderer.getDefaultValueForChart(highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH);
3366
+
3367
+ chartOptions.chart = {
3368
+ type: 'waterfall',
3369
+ zoomType: additionOptions && additionOptions.chart && additionOptions.chart.zoom_type ? additionOptions.chart.zoom_type : 'None',
3370
+ };
3371
+ if (disableAnimation) {
3372
+ chartOptions.chart.animation = false;
3373
+ }
3374
+ const walkthroughFieldIsNotSet = lodash.some(pivotData.getRowKeys(), rowKey => !rowKey || lodash.isArray(rowKey) && !rowKey.length);
3375
+
3376
+ chartOptions.xAxis = {
3377
+ type: 'category',
3378
+ crosshair: true,
3379
+ min: 0,
3380
+ title: {
3381
+ text : additionOptions && additionOptions.axisX ? additionOptions.axisX.name : '',
3382
+ },
3383
+ uniqueNames: walkthroughFieldIsNotSet,
3384
+ };
3385
+
3386
+ highchartsRenderer.setTitleAndSubTitle(chartOptions, opts, additionOptions);
3387
+
3388
+ chartOptions.yAxis = {
3389
+ min: null,
3390
+ max: null,
3391
+ title: {
3392
+ text: additionOptions && additionOptions.axisY ? additionOptions.axisY.name : '',
3393
+ autoylabel: additionOptions && additionOptions.axisY ? additionOptions.axisY.autoylabel : ''
3394
+ },
3395
+ labels: {
3396
+ formatter: highchartsRenderer.defaultValueLabelsFormatter(pivotData, opts)
3397
+ },
3398
+ };
3399
+ if (additionOptions) {
3400
+ highchartsRenderer.setYAxisMinMax(chartOptions.yAxis, additionOptions.axisY);
3401
+ }
3402
+
3403
+ chartOptions.tooltip = {
3404
+ formatter: highchartsRenderer.defaultFormatterToTooltip(pivotData, opts),
3405
+ valueDecimals: 2,
3406
+ };
3407
+
3408
+ highchartsRenderer.handleGridLines(additionOptions, chartOptions);
3409
+
3410
+ if (lodash.get(opts, 'paletteOptions.widgetPalette', null)) {
3411
+ const mc_palette = lodash.find(lodash.get(opts.paletteOptions, 'monochromePalettes', []), { selected: true });
3412
+ chartOptions.colors = mc_palette ? mc_palette.colors : opts.paletteOptions.widgetPalette;
3413
+ } else if (lodash.get(opts, 'paletteOptions.dashboardPalette.colors', null)) {
3414
+ chartOptions.colors = opts.paletteOptions.dashboardPalette.colors;
3415
+ }
3416
+ chartOptions.series = highchartsRenderer
3417
+ .ptCreateWaterfallWalkthroughSeries(pivotData, null, additionOptions, opts);
3418
+
3419
+ chartOptions = highchartsRenderer.prepareAxisX(chartOptions, additionOptions, pivotData.getColKeys());
3420
+ chartOptions.plotOptions = {
3421
+ waterfall: {
3422
+ pointPadding: 0.2,
3423
+ borderWidth: 0,
3424
+ borderRadius: 1,
3425
+ lineWidth: 0,
3426
+ },
3427
+ series: {
3428
+ animation: !disableAnimation,
3429
+ cropThreshold: 1000,
3430
+ dataLabels: {
3431
+ allowOverlap: additionOptions && additionOptions.label ? additionOptions.label.overlap : false,
3432
+ enabled: additionOptions && additionOptions.label ? additionOptions.label.show : true,
3433
+ formatter: highchartsRenderer.defaultDataLabelFormatter(pivotData, opts),
3434
+ style: highchartsRenderer.getDataLabelsStyle(additionOptions),
3435
+ inside: false
3436
+ },
3437
+ events: {
3438
+ legendItemClick: () => {
3439
+ return false;
3440
+ }
3441
+ }
3442
+ }
3443
+ };
3444
+
3445
+ if (opts.drillDownListFunc) {
3446
+ chartOptions.plotOptions.series.cursor = 'pointer';
3447
+ chartOptions.plotOptions.series.point = {
3448
+ events: {
3449
+ click: opts.drillDownListFunc
3450
+ }
3451
+ };
3452
+ }
3453
+ if (waterfallOptions.colors) {
3454
+ chartOptions.legend = highchartsRenderer.getOptionsForLegends(additionOptions, 3, false);
3455
+ chartOptions.legend.useHTML = true;
3456
+ chartOptions.legend.labelFormatter = function() {
3457
+ const name = this.options.className ? 'Total': this.name;
3458
+ const findTotal = _.find(this.options.data, {isTotal: true});
3459
+ const color = findTotal?.color ? findTotal.color : this.color;
3460
+ return '<span style="margin: 5px; vertical-align: middle; display:inline-block; background-color: '+ color + '; width: 12px; height: 12px; border-radius: 50%"></span><span style="color: #000; display: inline-block; margin: 5px; vertical-align: middle;">' + name + '</span>';
3461
+ }
3462
+
3463
+ chartOptions.legend.symbolPadding = 0;
3464
+ chartOptions.legend.symbolWidth = 0;
3465
+ chartOptions.legend.symbolHeight = 0;
3466
+ chartOptions.legend.squareSymbol = false;
3467
+ } else {
3468
+ chartOptions.legend = {
3469
+ enabled: false
3470
+ }
3471
+ }
3472
+
3473
+ return highchartsRenderer.ptCreateElementAndDraw(chartOptions, opts);
3474
+ }
3475
+
3286
3476
  highchartsRenderer.formatFieldValue = function (field, value) {
3287
3477
  let currentType = '';
3288
3478
  let format = field.format;
@@ -4351,6 +4541,17 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4351
4541
  }
4352
4542
  };
4353
4543
 
4544
+ highchartsRenderer.waterfallConstants = {
4545
+ [highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN]: {
4546
+ minCategoriesCount: 2,
4547
+ maxCategoriesCount: 5,
4548
+ },
4549
+ [highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH]: {
4550
+ minCategoriesCount: 2,
4551
+ maxCategoriesCount: 10,
4552
+ }
4553
+ };
4554
+
4354
4555
  highchartsRenderer.rhPivotView = function (rowData, options, isTable = false, widget = null) {
4355
4556
  if (!rowData || !rowData) {
4356
4557
  if (options.onlyOptions) {
@@ -4359,10 +4560,15 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4359
4560
  return null;
4360
4561
  }
4361
4562
 
4362
- if (widget && widget.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN) {
4363
- const breakdownSettings = widget.options.breakdown_options.settings;
4364
- const maxCategories = breakdownSettings.maxCategoriesCount;
4365
- const minCategories = breakdownSettings.minCategoriesCount;
4563
+ const isWaterfall = widget
4564
+ && (
4565
+ widget.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN
4566
+ || widget.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH
4567
+ );
4568
+
4569
+ if (isWaterfall) {
4570
+ const maxCategories = highchartsRenderer.waterfallConstants[widget.chart_type].maxCategoriesCount;
4571
+ const minCategories = highchartsRenderer.waterfallConstants[widget.chart_type].minCategoriesCount;
4366
4572
  const uniqueCategories = lodash.filter(
4367
4573
  lodash.uniq(
4368
4574
  lodash.map(rowData, row => row[widget.cols[0].name])
@@ -4372,11 +4578,13 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4372
4578
 
4373
4579
  if (uniqueCategories && (uniqueCategories.length > maxCategories || uniqueCategories.length < minCategories )) {
4374
4580
  options.error_has_occurred = true;
4581
+ const isDateField = widget.cols[0].type === 'Date';
4582
+ const commonMessagePart = `This chart support a selection of ${minCategories}-${maxCategories} items from the category section. `;
4375
4583
  options.error_params = {
4376
4584
  title: 'Data Conflict',
4377
4585
  text: `Please adjust your dashboard's reference date and filter selections as \
4378
4586
  the quantity of data doesn't match the chart's ${ minCategories }-${ maxCategories } value limit.`,
4379
- class: 'nodata',
4587
+ class: uniqueCategories.length < minCategories ? 'waterfall-nodata' : 'waterfall-too-much-data',
4380
4588
  }
4381
4589
  return highchartsRenderer.getNoDataResult(options.rendererOptions, true);
4382
4590
  }
@@ -4620,19 +4828,25 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4620
4828
  return highchartsRenderer.getWeekNumber(dateObj);
4621
4829
  };
4622
4830
 
4623
- highchartsRenderer.check_value_not_for_convert = function (currentgraph, field_name) {
4624
- let val_not_convert = null;
4831
+ highchartsRenderer.check_values_not_for_convert = function (currentgraph, field_name) {
4832
+ let vals_not_convert = [];
4625
4833
  if (lodash.has(currentgraph, "options.chartOptions.delta_column") && currentgraph.options.chartOptions.delta_column) {
4626
4834
  let delta_options = currentgraph.options.chartOptions.delta_column;
4627
4835
  if (delta_options.field == 'series' && currentgraph.rows && currentgraph.rows[0] &&
4628
4836
  currentgraph.rows[0].name == field_name) {
4629
- val_not_convert = delta_options.name;
4837
+ vals_not_convert = [delta_options.name];
4630
4838
  } else if (delta_options.field == 'category' && currentgraph.rows && currentgraph.cols[0] &&
4631
4839
  currentgraph.cols[0].name == field_name) {
4632
- val_not_convert = delta_options.name;
4840
+ vals_not_convert = [delta_options.name];
4633
4841
  }
4842
+ } else if (currentgraph.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH) {
4843
+ lodash.forEach(currentgraph.options.walkthrough_options.values.walkthrough, value => {
4844
+ if (value.trend === 'total') {
4845
+ vals_not_convert.push(value.key[0]);
4846
+ }
4847
+ });
4634
4848
  }
4635
- return val_not_convert;
4849
+ return vals_not_convert;
4636
4850
  };
4637
4851
 
4638
4852
  highchartsRenderer.updateFiltersShowNames = function (filters) {
@@ -4652,8 +4866,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4652
4866
  })
4653
4867
  };
4654
4868
 
4655
- highchartsRenderer.returnRawDataValue = function (type, value, format, field_name, val_not_for_convert) {
4656
- if (val_not_for_convert && val_not_for_convert == value) {
4869
+ highchartsRenderer.returnRawDataValue = function (type, value, format, field_name, vals_not_for_convert) {
4870
+ if (vals_not_for_convert && vals_not_for_convert.length && lodash.includes(vals_not_for_convert, value)) {
4657
4871
  return value;
4658
4872
  }
4659
4873
 
@@ -4965,12 +5179,28 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4965
5179
  }
4966
5180
  });
4967
5181
 
5182
+ // add virtual fields to rows if required
5183
+ let rows = widgetOptions.rows;
5184
+ if (!lodash.get(widgetOptions, 'rows.length') && widgetOptions.options.breakdown_options) {
5185
+ rows = [
5186
+ {
5187
+ id: -1,
5188
+ name: highchartsRenderer.VIRTUAL_FIELDS.WATERFALL_VARIANCE,
5189
+ type: 'Text',
5190
+ },
5191
+ ];
5192
+ }
5193
+
4968
5194
  // fill rows fields
4969
- lodash.forEach(widgetOptions.rows, function (valObj) {
4970
- fieldOb = lodash.find(fields, {id: valObj.id});
4971
- if (fieldOb) {
4972
- legendFields.push(fieldOb);
4973
- lodash.remove(fields, {id: fieldOb.id});
5195
+ lodash.forEach(rows, function (valObj) {
5196
+ if (lodash.includes(highchartsRenderer.VIRTUAL_FIELDS, valObj.name)) {
5197
+ legendFields.push(valObj);
5198
+ } else {
5199
+ fieldOb = lodash.find(fields, {id: valObj.id});
5200
+ if (fieldOb) {
5201
+ legendFields.push(fieldOb);
5202
+ lodash.remove(fields, {id: fieldOb.id});
5203
+ }
4974
5204
  }
4975
5205
  });
4976
5206
 
@@ -5097,71 +5327,22 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
5097
5327
  highchartsRenderer.addTemplateDataToCalcModel = function (selectedTemplate, calcModelOptions) {
5098
5328
  highchartsRenderer.setWidgetFieldsToTemplate(selectedTemplate);
5099
5329
 
5100
- const scenarioName = 'scenario';
5101
- const fields = highchartsRenderer.objectCopyJsonMethod(selectedTemplate.fields);
5102
- const fieldScenarioAlias = _.find(fields, field => (field.alias || '').toLowerCase() === scenarioName)
5103
- const fieldScenario = _.find(fields, field => (field.name || '').toLowerCase() === scenarioName)
5104
- const filters = calcModelOptions.config && calcModelOptions.config.filters;
5105
-
5106
- const filterFields = [];
5107
- const valueFields = [];
5108
- const dateFields = [];
5109
- const dataTypeFields = [];
5110
- const dataSeriesFields = [];
5111
-
5112
- let scenarioField = lodash.get(calcModelOptions, 'config.scenario', undefined) || fieldScenarioAlias || fieldScenario;
5113
- let fieldOb;
5114
-
5115
- const fillData = (fieldsArr, destinationArr) => {
5116
- lodash.forEach(fieldsArr, function (valObj) {
5117
- fieldOb = lodash.find(fields, { id: valObj.id });
5118
- if (fieldOb) {
5119
- destinationArr.push(fieldOb);
5120
- lodash.remove(fields, { id: fieldOb.id });
5121
- }
5122
- });
5123
- }
5330
+ var fields = highchartsRenderer.objectCopyJsonMethod(selectedTemplate.widget_fields);
5331
+ var fieldOb;
5332
+ var selectedFields = [];
5124
5333
 
5125
- lodash.forEach(filters, function (filterObj) {
5126
- fieldOb = lodash.find(fields, { id: filterObj.id });
5127
- if (fieldOb && filterObj.values && filterObj.values.datetype && filterObj.values.datetype === 'list') {
5128
- filterObj.values = filterObj.values.val
5129
- } else if (fieldOb && filterObj.values && filterObj.values.datetype && filterObj.values.datetype !== 'list') {
5130
- fieldOb.values = filterObj.values;
5131
- } else if (fieldOb && filterObj.values && filterObj.values.type === 'advanced') {
5132
- fieldOb.values = filterObj.values;
5133
- }
5134
- if (fieldOb && filterObj.values && filterObj.values instanceof Array) {
5135
- if (filterObj.is_excluded == true) {
5136
- fieldOb.excludes = filterObj.values;
5137
- } else {
5138
- fieldOb.includes = filterObj.values;
5139
- }
5140
- }
5141
- if (filterObj.allow_nulls && fieldOb) {
5142
- fieldOb.allow_nulls = filterObj.allow_nulls;
5334
+ // fill selected fields
5335
+ lodash.forEach(calcModelOptions.fields, function (valObj) {
5336
+ fieldOb = lodash.find(fields, {id: valObj.id});
5337
+ if (fieldOb) {
5338
+ selectedFields.push(fieldOb);
5339
+ lodash.remove(fields, {id: fieldOb.id});
5143
5340
  }
5144
5341
  });
5145
5342
 
5146
- const storedGroupByFields = lodash.get(calcModelOptions, 'config.group_by', []);
5147
- const storedDateFields = [lodash.get(calcModelOptions, 'config.date_field', undefined)].filter(f => !!f);
5148
- const storedAggFields = [lodash.get(calcModelOptions, 'config.agg_field', undefined)].filter(f => !!f);
5149
- const storedDataTypeFields = [lodash.get(calcModelOptions, 'config.data_type_field', undefined)].filter(f => !!f);
5150
-
5151
- fillData(storedGroupByFields, dataSeriesFields);
5152
- fillData(storedDateFields, dateFields);
5153
- fillData(storedAggFields, valueFields);
5154
- fillData(storedDataTypeFields, dataTypeFields);
5155
- fillData(filters, filterFields);
5156
-
5157
5343
  calcModelOptions.pivot = {
5158
5344
  fieldsArray: fields,
5159
- selectedFieldsArray: dataSeriesFields,
5160
- filtersArray: filterFields,
5161
- scenarioField,
5162
- dateFields,
5163
- dataTypeFields,
5164
- valueFields
5345
+ selectedFieldsArray: selectedFields
5165
5346
  };
5166
5347
  }
5167
5348
 
@@ -5660,7 +5841,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
5660
5841
  return valToReturn;
5661
5842
  };
5662
5843
 
5663
-
5844
+
5664
5845
  highchartsRenderer.getChartAxisLabel = function(type) {
5665
5846
  return highchartsRenderer.chartsTypesInfo[type] ? highchartsRenderer.chartsTypesInfo[type].axisName : CHART_AXIS_DEFAULT_LABEL;
5666
5847
  };
@@ -6495,7 +6676,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6495
6676
  value_name: 'show',
6496
6677
  default_value: true,
6497
6678
  disabled_str: '!{var}.show_out_of_x_axis && !{var}.show_out_of_data_series && !{var}.show_value && !{var}.show_x_axis && !{var}.show_data_series',
6498
- disabled_fn: (value) => !value.show_out_of_x_axis
6679
+ disabled_fn: (value) => !value.show_out_of_x_axis
6499
6680
  && !value.show_out_of_data_series
6500
6681
  && !value.show_value
6501
6682
  && !value.show_x_axis
@@ -6536,8 +6717,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6536
6717
  element_label: '[X Axis]',
6537
6718
  value_name: 'show_x_axis',
6538
6719
  default_value: true,
6539
- clickFn: (value) => value.show = value.show
6540
- ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6720
+ clickFn: (value) => value.show = value.show
6721
+ ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6541
6722
  : value.show,
6542
6723
  },
6543
6724
  {
@@ -6545,8 +6726,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6545
6726
  element_label: '[Data Series]',
6546
6727
  value_name: 'show_data_series',
6547
6728
  default_value: true,
6548
- clickFn: (value) => value.show = value.show
6549
- ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6729
+ clickFn: (value) => value.show = value.show
6730
+ ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6550
6731
  : value.show,
6551
6732
  },
6552
6733
  {
@@ -6554,8 +6735,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6554
6735
  element_label: 'Value',
6555
6736
  value_name: 'show_value',
6556
6737
  default_value: true,
6557
- clickFn: (value) => value.show = value.show
6558
- ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6738
+ clickFn: (value) => value.show = value.show
6739
+ ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6559
6740
  : value.show,
6560
6741
  },
6561
6742
  {
@@ -6563,8 +6744,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6563
6744
  element_label: '% Out of [X Axis]',
6564
6745
  value_name: 'show_out_of_x_axis',
6565
6746
  default_value: false,
6566
- clickFn: (value) => value.show = value.show
6567
- ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6747
+ clickFn: (value) => value.show = value.show
6748
+ ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6568
6749
  : value.show,
6569
6750
  },
6570
6751
  {
@@ -6572,8 +6753,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6572
6753
  element_label: '% Out of [Data Series]',
6573
6754
  value_name: 'show_out_of_data_series',
6574
6755
  default_value: false,
6575
- clickFn: (value) => value.show = value.show
6576
- ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6756
+ clickFn: (value) => value.show = value.show
6757
+ ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6577
6758
  : value.show,
6578
6759
  },
6579
6760
  ]
@@ -6747,16 +6928,16 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6747
6928
  value_name: 'name',
6748
6929
  element_label: 'Name',
6749
6930
  default_value: '_Variance'
6750
- }, {
6751
- element_type: 'input',
6752
- value_name: 'formula',
6753
- element_label: 'Formula',
6754
- default_value: 'x2-x1'
6755
6931
  }, {
6756
6932
  element_type: 'input',
6757
- value_name: 'color',
6758
- element_label: 'Color',
6759
- default_value: ''
6933
+ value_name: 'formula',
6934
+ element_label: 'Formula',
6935
+ default_value: 'x2-x1'
6936
+ }, {
6937
+ element_type: 'input',
6938
+ value_name: 'color',
6939
+ element_label: 'Color',
6940
+ default_value: ''
6760
6941
  }, {
6761
6942
  element_type: 'radio',
6762
6943
  value_name: 'chart',
@@ -6879,7 +7060,17 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6879
7060
  axisTooltipDescription: 'The category (usually an independent variable) is shown on the x-axis and should be between 2 to 5 total columns. ',
6880
7061
  legendTooltipTitle: 'Drag one field to further configure your x-axis.',
6881
7062
  legendTooltipDescription: 'The breakdown subdivides the chart by a category field for further analysis of what’s contributing to the increase or decrease.',
6882
- },
7063
+ },
7064
+ [highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH]: {
7065
+ name: 'Waterfall Walkthrough Chart ',
7066
+ label: 'Waterfall Walkthrough Chart ',
7067
+ title: 'TODO: add text',
7068
+ description: 'TODO: add text',
7069
+ axisName: 'Category',
7070
+ startedMessage: 'TODO: add text',
7071
+ axisTooltipTitle: 'TODO: add text',
7072
+ legendTooltipTitle: 'TODO: add text',
7073
+ },
6883
7074
  'combo-chart': {
6884
7075
  name: 'Combo Chart ',
6885
7076
  label: 'Combo Chart ',
@@ -7535,6 +7726,24 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7535
7726
  highchartsRenderer.suboptions["legends"],
7536
7727
  ]
7537
7728
  },
7729
+ {
7730
+ type: highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH,
7731
+ name: highchartsRenderer.chartsTypesInfo[highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH].name,
7732
+ class: 'google-visualization-charteditor-thumbs-columnchart',
7733
+ render: highchartsRenderer.ptRenderWaterfallWalkthrough,
7734
+ suboptions: [
7735
+ highchartsRenderer.suboptions["axisX"],
7736
+ highchartsRenderer.suboptions["tooltips"],
7737
+ highchartsRenderer.suboptions["label"],
7738
+ highchartsRenderer.suboptions["subtitle"],
7739
+ highchartsRenderer.suboptions["widget_library"],
7740
+ highchartsRenderer.suboptions["chart"],
7741
+ highchartsRenderer.suboptions["negative_number_format"],
7742
+ highchartsRenderer.suboptions["advanced"],
7743
+ highchartsRenderer.suboptions["legends"],
7744
+ ],
7745
+ hidden: true,
7746
+ },
7538
7747
  ]
7539
7748
  },
7540
7749
  ];
@@ -7691,7 +7900,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7691
7900
  _.forEach(Object.keys(dates), key => {
7692
7901
  const dateConfiguration = dates[key];
7693
7902
  const timestamp = dateConfiguration.timestamp;
7694
- if (timestamp) {
7903
+ if (timestamp) {
7695
7904
  const dateTzOffsetInSeconds = new Date(timestamp * 1000).getTimezoneOffset() * 60;
7696
7905
  dateConfiguration.displayedValue = new Date((timestamp + dateTzOffsetInSeconds) * 1000)
7697
7906
  .toLocaleDateString();
@@ -7987,10 +8196,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7987
8196
  };
7988
8197
 
7989
8198
  highchartsRenderer.createDateFromString = function (dateString, format) {
7990
- if ((format && !highchartsRenderer.isDateFormat(dateString, format)) || !highchartsRenderer.isDate(dateString)) {
8199
+ if (!(format && highchartsRenderer.isDateFormat(dateString, format) || highchartsRenderer.isDate(dateString))) {
7991
8200
  return null;
7992
8201
  }
7993
- const utcDate = format
8202
+ const utcDate = format
7994
8203
  ? moment_lib.utc(dateString, format, true)
7995
8204
  : moment_lib.utc(dateString);
7996
8205
  return utcDate.startOf('day').unix();
@@ -8008,7 +8217,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8008
8217
  }
8009
8218
 
8010
8219
  let filters = [];
8011
-
8220
+
8012
8221
  if (widget.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN) {
8013
8222
  const colFilter = highchartsRenderer.createFilterObject(widget.cols[0]);
8014
8223
  const labels = [];
@@ -8036,7 +8245,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8036
8245
  col_value,
8037
8246
  highchartsRenderer.getDateFieldFormat(widget, widget.cols[index])
8038
8247
  );
8039
-
8248
+
8040
8249
  if ($.isEmptyObject(datetrange)) {
8041
8250
  return;
8042
8251
  }
@@ -8141,6 +8350,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8141
8350
  filter.is_excluded = false;
8142
8351
  } else {
8143
8352
  filter = highchartsRenderer.createDrillDownFilterObject(widget, widget.cols[0], colKey[0]);
8353
+ filters.push(filter);
8144
8354
  }
8145
8355
  filter.values = [];
8146
8356
  for (let i = 0; i < colKey.length; i++) {
@@ -8278,7 +8488,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8278
8488
  var data = res;
8279
8489
 
8280
8490
  lodash.forEach(datesFields, function (row) {
8281
- row.val_not_convert = highchartsRenderer.check_value_not_for_convert(widget, row.name);
8491
+ row.val_not_convert = highchartsRenderer.check_values_not_for_convert(widget, row.name);
8282
8492
  });
8283
8493
 
8284
8494
  if (datesFields.length > 0) {
@@ -8684,14 +8894,14 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8684
8894
  return rightPosition;
8685
8895
  case 'none':
8686
8896
  return none;
8897
+ }
8898
+ } else if (isLine) {
8899
+ return useNewUx ? leftPosition : rightPosition;
8900
+ } else if (isPie) {
8901
+ return useNewUx ? rightPosition : topPosition;
8687
8902
  }
8688
- } else if (isLine) {
8689
- return useNewUx ? leftPosition : rightPosition;
8690
- } else if (isPie) {
8691
- return useNewUx ? rightPosition : topPosition;
8692
- }
8693
8903
 
8694
- return useNewUx ? topPosition : bottomPosition;
8904
+ return useNewUx ? topPosition : bottomPosition;
8695
8905
  }
8696
8906
 
8697
8907
  highchartsRenderer.setYAxisMinMax = function (yAxis, axisYOptions) {
@@ -8706,7 +8916,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8706
8916
  }
8707
8917
 
8708
8918
  highchartsRenderer.getDateFieldFormat = function(widget, dateField) {
8709
- const aggregationConfig = widget.options && widget.options.date_aggregation_configs
8919
+ const aggregationConfig = widget.options && widget.options.date_aggregation_configs
8710
8920
  ? _.find(widget.options.date_aggregation_configs, { field_id: dateField.id })
8711
8921
  : null;
8712
8922
 
@@ -8743,7 +8953,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8743
8953
  rows = [];
8744
8954
  } else {
8745
8955
  rows = cols;
8746
- cols = [];
8956
+ cols = [point.colKeys[1]];
8747
8957
  }
8748
8958
  return { rows, cols };
8749
8959
  }
@@ -28,8 +28,6 @@ let initNovixRenderer = function($, window, document, Handsontable){
28
28
  const delim = " , ";
29
29
  const subtotal = "subtotalDatarailsPlaceholder";
30
30
  const replaceValue = "SubTotals";
31
- const useNewUx = document.ReportHippo && document.ReportHippo && document.ReportHippo.user &&
32
- document.ReportHippo.user.organization.settings && document.ReportHippo.user.organization.settings.use_new_ux;
33
31
 
34
32
  $.pivotUtilities.novix_renderers = {
35
33
 
@@ -889,9 +887,14 @@ let initNovixRenderer = function($, window, document, Handsontable){
889
887
 
890
888
  // inject the widgetId to the class name so we can separate the tables by it
891
889
  // look for the search side on line 653 "opts.$el.find(".widget-id-" + opts.widgetId);"
892
- return `<div class='novixPivot widget-id-${opts.widgetId} ${
893
- useNewUx && opts.chartOptions.table_options.use_new_table_design ? 'handsontable-new' : ''
894
- }' style='overflow:auto'></div>`;
890
+ var tableClasses = ['novixPivot', `widget-id-${opts.widgetId}`];
891
+ if (opts.chartOptions.table_options.use_new_table_design) {
892
+ tableClasses.push('handsontable-new');
893
+ }
894
+ if (!pvtData.aggregator().uniq) {
895
+ tableClasses.push('numbers-to-right');
896
+ }
897
+ return `<div class='${tableClasses.join(' ')}' style='overflow:auto'></div>`;
895
898
  }
896
899
 
897
900
  };
package/src/pivot.css CHANGED
@@ -29,9 +29,6 @@ table.pvtTable tbody tr th > i {
29
29
  font-size: 10px;
30
30
  }
31
31
 
32
- table.pvtTable .pvtColLabel {text-align: center;}
33
- table.pvtTable .pvtTotalLabel {text-align: right;}
34
-
35
32
  table.pvtTable tbody tr td {
36
33
  color: #3D3D3D;
37
34
  padding: 5px;
@@ -263,11 +260,6 @@ table.pvtTable.newPvtTable tbody tr td.rowTotal {
263
260
  background-color: #dfe6ec !important;
264
261
  border-color: #ffffff !important;
265
262
  }
266
- table.pvtTable.newPvtTable .pvtColLabel,
267
- table.pvtTable.newPvtTable .pvtTotalLabel,
268
- table.pvtTable.newPvtTable .pvtTotalLabel.rowTotal {
269
- text-align: left;
270
- }
271
263
 
272
264
  table.pvtTable.newPvtTable tbody tr th .fa {
273
265
  padding: 2px;
@@ -408,3 +400,27 @@ table.pvtTable.newPvtTable tbody tr td:hover:after {
408
400
  top: 4px;
409
401
  font-size: 12px;
410
402
  }
403
+
404
+
405
+ /* Table cells alignment */
406
+ table.pvtTable .pvtColLabel {text-align: center;}
407
+ table.pvtTable .pvtTotalLabel {text-align: right;}
408
+
409
+ table.pvtTable.newPvtTable .pvtColLabel,
410
+ table.pvtTable.newPvtTable .pvtTotalLabel,
411
+ table.pvtTable.newPvtTable .pvtTotalLabel.rowTotal {
412
+ text-align: left;
413
+ }
414
+
415
+ table.pvtTable thead tr th.pvtColLabel,
416
+ table.pvtTable thead tr th.pvtTotalLabel {
417
+ text-align: center !important;
418
+ }
419
+
420
+ table.pvtTable.numbers-to-right tbody tr td.pvtVal,
421
+ table.pvtTable.numbers-to-right tbody tr td.rowTotal.rowTotal,
422
+ table.pvtTable.numbers-to-right tbody tr td.pvtGrandTotal {
423
+ text-align: right !important;
424
+ padding-right: 9px;
425
+ line-height: 15px;
426
+ }