@datarailsshared/dr_renderer 1.2.231 → 1.2.232-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 +1 -1
- package/src/highcharts_renderer.js +293 -30
package/package.json
CHANGED
|
@@ -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,6 +84,7 @@ 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',
|
|
@@ -486,7 +489,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
486
489
|
rows = [];
|
|
487
490
|
}
|
|
488
491
|
|
|
489
|
-
var cols = this.key;
|
|
492
|
+
var cols = lodash.get(this, 'point.options.colsForTotal') || this.key;
|
|
490
493
|
if (typeof (cols) == 'object' && cols.name) {
|
|
491
494
|
cols = cols.name;
|
|
492
495
|
}
|
|
@@ -619,6 +622,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
619
622
|
|
|
620
623
|
var func = function () {
|
|
621
624
|
const isWaterfallBreakdown = this.series.options.className === SERIES_CLASSNAMES.WATERFALL_BREAKDOWN;
|
|
625
|
+
const isWaterfallWalkthrough = this.series.options.className === SERIES_CLASSNAMES.WATERFALL_WALKTHROUGH;
|
|
622
626
|
const isTrendSeries = this.series.options.className === SERIES_CLASSNAMES.TREND_SERIES;
|
|
623
627
|
|
|
624
628
|
var y = parseFloat(this.y);
|
|
@@ -633,7 +637,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
633
637
|
|| isTrendSeries) {
|
|
634
638
|
rows = [];
|
|
635
639
|
}
|
|
636
|
-
|
|
640
|
+
|
|
641
|
+
var cols = lodash.get(this, 'point.options.colsForTotal') || this.key;
|
|
637
642
|
if (!cols && is_drill_down_pie) {
|
|
638
643
|
cols = this.name;
|
|
639
644
|
}
|
|
@@ -648,7 +653,9 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
648
653
|
if (variant_name && rows && rows[0] && variant_name == rows[0]) {
|
|
649
654
|
rows[0] = variant_name_default_name;
|
|
650
655
|
}
|
|
651
|
-
|
|
656
|
+
if (isWaterfallWalkthrough) {
|
|
657
|
+
cols = [this.key]
|
|
658
|
+
}
|
|
652
659
|
try {
|
|
653
660
|
if (is_drill_down_pie && !highchartsRenderer.selfStartsWith(series_name,"Series ")) {
|
|
654
661
|
let temp = cols;
|
|
@@ -656,7 +663,9 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
656
663
|
rows = temp;
|
|
657
664
|
}
|
|
658
665
|
|
|
659
|
-
var category_text = `<span style="font-weight: bold;"
|
|
666
|
+
var category_text = `<span style="font-weight: bold;">
|
|
667
|
+
${ lodash.get(this, 'point.options.colsForTotal') ? cols[0] : cols } ${ isWaterfallBreakdown ? ': ' : ' ' }
|
|
668
|
+
</span>`;
|
|
660
669
|
if (this.category) {
|
|
661
670
|
category_text = '';
|
|
662
671
|
}
|
|
@@ -1037,6 +1046,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1037
1046
|
if (row_n_value && row_n_value.length > 0) {
|
|
1038
1047
|
ob.name = row_n_value.join(highchartsRenderer.delimer).replace('DR_Others', othersName);
|
|
1039
1048
|
}
|
|
1049
|
+
|
|
1040
1050
|
lodash.forEach(col_n_keys, function (col_n_value, index) {
|
|
1041
1051
|
var agg = pivotData.getAggregator(row_n_value, col_n_value);
|
|
1042
1052
|
var val = agg.value();
|
|
@@ -1253,6 +1263,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1253
1263
|
if (opts.trendLine) {
|
|
1254
1264
|
const a = ((ySum * squareXSum) - (xSum * xySum)) / ((n * squareXSum) - (xSum * xSum));
|
|
1255
1265
|
const b = ((n * xySum) - (xSum* ySum)) / ((n * squareXSum) - (xSum * xSum));
|
|
1266
|
+
|
|
1256
1267
|
const trendSeries = lodash.clone(chart_series[chart_series.length - 1]);
|
|
1257
1268
|
trendSeries.className = 'trendSeries';
|
|
1258
1269
|
trendSeries.name = highchartsRenderer.getTrendSeriesName(trendSeries);
|
|
@@ -1263,6 +1274,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1263
1274
|
if (colors && colors[i]) {
|
|
1264
1275
|
trendSeries.color = colors[i];
|
|
1265
1276
|
}
|
|
1277
|
+
|
|
1266
1278
|
trendSerieses.push(trendSeries);
|
|
1267
1279
|
}
|
|
1268
1280
|
i++;
|
|
@@ -1279,6 +1291,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1279
1291
|
}
|
|
1280
1292
|
|
|
1281
1293
|
let weights = { line: 2,spline: 3 ,area:-2, areaspline: -1, scatter:4, column: 1 };
|
|
1294
|
+
|
|
1282
1295
|
if (opts.comboOptions && lodash.includes(chartType,'combo') && !lodash.isEqual(row_n_keys, EMPTY_ROW_N_KEYS)) {
|
|
1283
1296
|
chart_series.forEach((series, seriesIndex) => {
|
|
1284
1297
|
const savedSeriesOption = lodash.find(opts.comboOptions.seriesOptions, {series: series.name});
|
|
@@ -1413,6 +1426,89 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1413
1426
|
return chart_series;
|
|
1414
1427
|
}
|
|
1415
1428
|
|
|
1429
|
+
highchartsRenderer.ptCreateWaterfallWalkthroughSeries = function (pivotData, onlyNumbers, additionOptions, opts) {
|
|
1430
|
+
const waterfallOptions = opts.walkthrough_options;
|
|
1431
|
+
const chart_series = [];
|
|
1432
|
+
let resultObject = {
|
|
1433
|
+
data: [],
|
|
1434
|
+
dataLabels: {
|
|
1435
|
+
allowOverlap: additionOptions && additionOptions.label ? additionOptions.label.overlap : false,
|
|
1436
|
+
enabled: additionOptions && additionOptions.label ? additionOptions.label.show : true,
|
|
1437
|
+
formatter: highchartsRenderer.defaultDataLabelFormatter(pivotData, {'chartOptions': additionOptions, total_value_options: opts.total_value_options}),
|
|
1438
|
+
style: highchartsRenderer.getDataLabelsStyle(additionOptions),
|
|
1439
|
+
},
|
|
1440
|
+
upColor: waterfallOptions.colors.increase,
|
|
1441
|
+
color: waterfallOptions.colors.decrease,
|
|
1442
|
+
className: SERIES_CLASSNAMES.WATERFALL_WALKTHROUGH
|
|
1443
|
+
};
|
|
1444
|
+
resultObject = highchartsRenderer.getDataLabelsOptions(additionOptions, resultObject);
|
|
1445
|
+
lodash.forEach(waterfallOptions.values.walkthrough, function(value, index) {
|
|
1446
|
+
|
|
1447
|
+
let keys = [];
|
|
1448
|
+
if (value.trend === 'total') {
|
|
1449
|
+
keys = ['Total'];
|
|
1450
|
+
} else {
|
|
1451
|
+
_.forEach(value.key, (item) => {
|
|
1452
|
+
const findKeyByValue = Object.keys(pivotData.dateValuesDictionary || {}).find(key => pivotData.dateValuesDictionary[key] === item);
|
|
1453
|
+
keys.push(findKeyByValue ? findKeyByValue : item);
|
|
1454
|
+
})
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
const agg = pivotData.getAggregator([], keys);
|
|
1458
|
+
let val = agg.value();
|
|
1459
|
+
|
|
1460
|
+
if (val != null && $.isNumeric(val)) {
|
|
1461
|
+
val = parseFloat(val);
|
|
1462
|
+
} else if (onlyNumbers) {
|
|
1463
|
+
val = NaN;
|
|
1464
|
+
} else {
|
|
1465
|
+
val = 0;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
if (value.trend === 'decrease') {
|
|
1469
|
+
val = val * -1;
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
const name = value.trend === 'total' ? value.formattedKey || value.key[0] : keys.join(highchartsRenderer.delimer);
|
|
1473
|
+
let color = '';
|
|
1474
|
+
if (value.trend !== 'total') {
|
|
1475
|
+
if (index === 0 && !firstBarColor) {
|
|
1476
|
+
color = waterfallOptions.colors.total;
|
|
1477
|
+
firstBarColor = waterfallOptions.colors.total;
|
|
1478
|
+
} else {
|
|
1479
|
+
color = value.color
|
|
1480
|
+
}
|
|
1481
|
+
} else {
|
|
1482
|
+
color = waterfallOptions.colors.total;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
resultObject.data.push({
|
|
1486
|
+
y: val,
|
|
1487
|
+
name: lodash.unescape(name).replace('DR_Others', highchartsRenderer.getOthersName(opts)),
|
|
1488
|
+
isSum: value.trend === 'total',
|
|
1489
|
+
isTotal: value.trend === 'total',
|
|
1490
|
+
color,
|
|
1491
|
+
colsForTotal: value.trend === 'total' ? keys : null,
|
|
1492
|
+
});
|
|
1493
|
+
});
|
|
1494
|
+
chart_series.push(resultObject);
|
|
1495
|
+
chart_series.push(
|
|
1496
|
+
{
|
|
1497
|
+
name: 'Positive',
|
|
1498
|
+
visible: false,
|
|
1499
|
+
color: waterfallOptions.colors.increase
|
|
1500
|
+
});
|
|
1501
|
+
|
|
1502
|
+
chart_series.push(
|
|
1503
|
+
{
|
|
1504
|
+
name: 'Negative',
|
|
1505
|
+
visible: false,
|
|
1506
|
+
color: waterfallOptions.colors.decrease
|
|
1507
|
+
});
|
|
1508
|
+
|
|
1509
|
+
return chart_series;
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1416
1512
|
highchartsRenderer.setChartTypeBySeriesType = function (type, series) {
|
|
1417
1513
|
const types = {
|
|
1418
1514
|
'line-chart': 'line',
|
|
@@ -3271,6 +3367,121 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
3271
3367
|
return highchartsRenderer.ptCreateElementAndDraw(chartOptions, opts);
|
|
3272
3368
|
};
|
|
3273
3369
|
|
|
3370
|
+
highchartsRenderer.ptRenderWaterfallWalkthrough = function (pivotData, opts) {
|
|
3371
|
+
let chartOptions = {};
|
|
3372
|
+
const waterfallOptions = opts?.walkthrough_options;
|
|
3373
|
+
const additionOptions = opts.chartOptions
|
|
3374
|
+
? opts.chartOptions
|
|
3375
|
+
: highchartsRenderer.getDefaultValueForChart(highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH);
|
|
3376
|
+
|
|
3377
|
+
chartOptions.chart = {
|
|
3378
|
+
type: 'waterfall',
|
|
3379
|
+
zoomType: additionOptions && additionOptions.chart && additionOptions.chart.zoom_type ? additionOptions.chart.zoom_type : 'None',
|
|
3380
|
+
};
|
|
3381
|
+
if (disableAnimation) {
|
|
3382
|
+
chartOptions.chart.animation = false;
|
|
3383
|
+
}
|
|
3384
|
+
|
|
3385
|
+
chartOptions.xAxis = {
|
|
3386
|
+
type: 'category',
|
|
3387
|
+
crosshair: true,
|
|
3388
|
+
min: 0,
|
|
3389
|
+
title: {
|
|
3390
|
+
text : additionOptions && additionOptions.axisX ? additionOptions.axisX.name : '',
|
|
3391
|
+
},
|
|
3392
|
+
uniqueNames: false,
|
|
3393
|
+
};
|
|
3394
|
+
|
|
3395
|
+
highchartsRenderer.setTitleAndSubTitle(chartOptions, opts, additionOptions);
|
|
3396
|
+
|
|
3397
|
+
chartOptions.yAxis = {
|
|
3398
|
+
min: null,
|
|
3399
|
+
max: null,
|
|
3400
|
+
title: {
|
|
3401
|
+
text: additionOptions && additionOptions.axisY ? additionOptions.axisY.name : '',
|
|
3402
|
+
autoylabel: additionOptions && additionOptions.axisY ? additionOptions.axisY.autoylabel : ''
|
|
3403
|
+
},
|
|
3404
|
+
labels: {
|
|
3405
|
+
formatter: highchartsRenderer.defaultValueLabelsFormatter(pivotData, opts)
|
|
3406
|
+
},
|
|
3407
|
+
};
|
|
3408
|
+
if (additionOptions) {
|
|
3409
|
+
highchartsRenderer.setYAxisMinMax(chartOptions.yAxis, additionOptions.axisY);
|
|
3410
|
+
}
|
|
3411
|
+
|
|
3412
|
+
chartOptions.tooltip = {
|
|
3413
|
+
formatter: highchartsRenderer.defaultFormatterToTooltip(pivotData, opts),
|
|
3414
|
+
valueDecimals: 2,
|
|
3415
|
+
};
|
|
3416
|
+
|
|
3417
|
+
highchartsRenderer.handleGridLines(additionOptions, chartOptions);
|
|
3418
|
+
|
|
3419
|
+
if (lodash.get(opts, 'paletteOptions.widgetPalette', null)) {
|
|
3420
|
+
const mc_palette = lodash.find(lodash.get(opts.paletteOptions, 'monochromePalettes', []), { selected: true });
|
|
3421
|
+
chartOptions.colors = mc_palette ? mc_palette.colors : opts.paletteOptions.widgetPalette;
|
|
3422
|
+
} else if (lodash.get(opts, 'paletteOptions.dashboardPalette.colors', null)) {
|
|
3423
|
+
chartOptions.colors = opts.paletteOptions.dashboardPalette.colors;
|
|
3424
|
+
}
|
|
3425
|
+
chartOptions.series = highchartsRenderer
|
|
3426
|
+
.ptCreateWaterfallWalkthroughSeries(pivotData, null, additionOptions, opts);
|
|
3427
|
+
|
|
3428
|
+
chartOptions = highchartsRenderer.prepareAxisX(chartOptions, additionOptions, pivotData.getColKeys());
|
|
3429
|
+
chartOptions.plotOptions = {
|
|
3430
|
+
waterfall: {
|
|
3431
|
+
pointPadding: 0.2,
|
|
3432
|
+
borderWidth: 0,
|
|
3433
|
+
borderRadius: 1,
|
|
3434
|
+
lineWidth: 0,
|
|
3435
|
+
},
|
|
3436
|
+
series: {
|
|
3437
|
+
animation: !disableAnimation,
|
|
3438
|
+
cropThreshold: 1000,
|
|
3439
|
+
dataLabels: {
|
|
3440
|
+
allowOverlap: additionOptions && additionOptions.label ? additionOptions.label.overlap : false,
|
|
3441
|
+
enabled: additionOptions && additionOptions.label ? additionOptions.label.show : true,
|
|
3442
|
+
formatter: highchartsRenderer.defaultDataLabelFormatter(pivotData, opts),
|
|
3443
|
+
style: highchartsRenderer.getDataLabelsStyle(additionOptions),
|
|
3444
|
+
inside: false
|
|
3445
|
+
},
|
|
3446
|
+
events: {
|
|
3447
|
+
legendItemClick: () => {
|
|
3448
|
+
return false;
|
|
3449
|
+
}
|
|
3450
|
+
}
|
|
3451
|
+
}
|
|
3452
|
+
};
|
|
3453
|
+
|
|
3454
|
+
if (opts.drillDownListFunc) {
|
|
3455
|
+
chartOptions.plotOptions.series.cursor = 'pointer';
|
|
3456
|
+
chartOptions.plotOptions.series.point = {
|
|
3457
|
+
events: {
|
|
3458
|
+
click: opts.drillDownListFunc
|
|
3459
|
+
}
|
|
3460
|
+
};
|
|
3461
|
+
}
|
|
3462
|
+
if (waterfallOptions.colors) {
|
|
3463
|
+
chartOptions.legend = highchartsRenderer.getOptionsForLegends(additionOptions, 3, false);
|
|
3464
|
+
chartOptions.legend.useHTML = true;
|
|
3465
|
+
chartOptions.legend.labelFormatter = function() {
|
|
3466
|
+
const name = this.options.className ? 'Total': this.name;
|
|
3467
|
+
const findTotal = _.find(this.options.data, {isTotal: true});
|
|
3468
|
+
const color = findTotal?.color ? findTotal.color : this.color;
|
|
3469
|
+
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>';
|
|
3470
|
+
}
|
|
3471
|
+
|
|
3472
|
+
chartOptions.legend.symbolPadding = 0;
|
|
3473
|
+
chartOptions.legend.symbolWidth = 0;
|
|
3474
|
+
chartOptions.legend.symbolHeight = 0;
|
|
3475
|
+
chartOptions.legend.squareSymbol = false;
|
|
3476
|
+
} else {
|
|
3477
|
+
chartOptions.legend = {
|
|
3478
|
+
enabled: false
|
|
3479
|
+
}
|
|
3480
|
+
}
|
|
3481
|
+
|
|
3482
|
+
return highchartsRenderer.ptCreateElementAndDraw(chartOptions, opts);
|
|
3483
|
+
}
|
|
3484
|
+
|
|
3274
3485
|
highchartsRenderer.formatFieldValue = function (field, value) {
|
|
3275
3486
|
let currentType = '';
|
|
3276
3487
|
let format = field.format;
|
|
@@ -4339,6 +4550,17 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
4339
4550
|
}
|
|
4340
4551
|
};
|
|
4341
4552
|
|
|
4553
|
+
highchartsRenderer.waterfallConstants = {
|
|
4554
|
+
[highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN]: {
|
|
4555
|
+
minCategoriesCount: 2,
|
|
4556
|
+
maxCategoriesCount: 5,
|
|
4557
|
+
},
|
|
4558
|
+
[highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH]: {
|
|
4559
|
+
minCategoriesCount: 2,
|
|
4560
|
+
maxCategoriesCount: 10,
|
|
4561
|
+
}
|
|
4562
|
+
};
|
|
4563
|
+
|
|
4342
4564
|
highchartsRenderer.rhPivotView = function (rowData, options, isTable = false, widget = null) {
|
|
4343
4565
|
if (!rowData || !rowData) {
|
|
4344
4566
|
if (options.onlyOptions) {
|
|
@@ -4347,10 +4569,15 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
4347
4569
|
return null;
|
|
4348
4570
|
}
|
|
4349
4571
|
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4572
|
+
const isWaterfall = widget
|
|
4573
|
+
&& (
|
|
4574
|
+
widget.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN
|
|
4575
|
+
|| widget.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH
|
|
4576
|
+
);
|
|
4577
|
+
|
|
4578
|
+
if (isWaterfall) {
|
|
4579
|
+
const maxCategories = highchartsRenderer.waterfallConstants[widget.chart_type].maxCategoriesCount;
|
|
4580
|
+
const minCategories = highchartsRenderer.waterfallConstants[widget.chart_type].minCategoriesCount;
|
|
4354
4581
|
const uniqueCategories = lodash.filter(
|
|
4355
4582
|
lodash.uniq(
|
|
4356
4583
|
lodash.map(rowData, row => row[widget.cols[0].name])
|
|
@@ -4360,6 +4587,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
4360
4587
|
|
|
4361
4588
|
if (uniqueCategories && (uniqueCategories.length > maxCategories || uniqueCategories.length < minCategories )) {
|
|
4362
4589
|
options.error_has_occurred = true;
|
|
4590
|
+
const isDateField = widget.cols[0].type === 'Date';
|
|
4591
|
+
const commonMessagePart = `This chart support a selection of ${minCategories}-${maxCategories} items from the category section. `;
|
|
4363
4592
|
options.error_params = {
|
|
4364
4593
|
title: 'Data Conflict',
|
|
4365
4594
|
text: `Please adjust your dashboard's reference date and filter selections as \
|
|
@@ -4608,19 +4837,25 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
4608
4837
|
return highchartsRenderer.getWeekNumber(dateObj);
|
|
4609
4838
|
};
|
|
4610
4839
|
|
|
4611
|
-
highchartsRenderer.
|
|
4612
|
-
let
|
|
4840
|
+
highchartsRenderer.check_values_not_for_convert = function (currentgraph, field_name) {
|
|
4841
|
+
let vals_not_convert = [];
|
|
4613
4842
|
if (lodash.has(currentgraph, "options.chartOptions.delta_column") && currentgraph.options.chartOptions.delta_column) {
|
|
4614
4843
|
let delta_options = currentgraph.options.chartOptions.delta_column;
|
|
4615
4844
|
if (delta_options.field == 'series' && currentgraph.rows && currentgraph.rows[0] &&
|
|
4616
4845
|
currentgraph.rows[0].name == field_name) {
|
|
4617
|
-
|
|
4846
|
+
vals_not_convert = [delta_options.name];
|
|
4618
4847
|
} else if (delta_options.field == 'category' && currentgraph.rows && currentgraph.cols[0] &&
|
|
4619
4848
|
currentgraph.cols[0].name == field_name) {
|
|
4620
|
-
|
|
4849
|
+
vals_not_convert = [delta_options.name];
|
|
4621
4850
|
}
|
|
4851
|
+
} else if (currentgraph.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH) {
|
|
4852
|
+
lodash.forEach(currentgraph.options.walkthrough_options.values.walkthrough, value => {
|
|
4853
|
+
if (value.trend === 'total') {
|
|
4854
|
+
vals_not_convert.push(value.key[0]);
|
|
4855
|
+
}
|
|
4856
|
+
});
|
|
4622
4857
|
}
|
|
4623
|
-
return
|
|
4858
|
+
return vals_not_convert;
|
|
4624
4859
|
};
|
|
4625
4860
|
|
|
4626
4861
|
highchartsRenderer.updateFiltersShowNames = function (filters) {
|
|
@@ -4640,8 +4875,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
4640
4875
|
})
|
|
4641
4876
|
};
|
|
4642
4877
|
|
|
4643
|
-
highchartsRenderer.returnRawDataValue = function (type, value, format, field_name,
|
|
4644
|
-
if (
|
|
4878
|
+
highchartsRenderer.returnRawDataValue = function (type, value, format, field_name, vals_not_for_convert) {
|
|
4879
|
+
if (vals_not_for_convert && vals_not_for_convert.length && lodash.includes(vals_not_for_convert, value)) {
|
|
4645
4880
|
return value;
|
|
4646
4881
|
}
|
|
4647
4882
|
|
|
@@ -6749,16 +6984,16 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6749
6984
|
value_name: 'name',
|
|
6750
6985
|
element_label: 'Name',
|
|
6751
6986
|
default_value: '_Variance'
|
|
6752
|
-
}, {
|
|
6753
|
-
element_type: 'input',
|
|
6754
|
-
value_name: 'formula',
|
|
6755
|
-
element_label: 'Formula',
|
|
6756
|
-
default_value: 'x2-x1'
|
|
6757
6987
|
}, {
|
|
6758
6988
|
element_type: 'input',
|
|
6759
|
-
value_name: '
|
|
6760
|
-
element_label: '
|
|
6761
|
-
default_value: ''
|
|
6989
|
+
value_name: 'formula',
|
|
6990
|
+
element_label: 'Formula',
|
|
6991
|
+
default_value: 'x2-x1'
|
|
6992
|
+
}, {
|
|
6993
|
+
element_type: 'input',
|
|
6994
|
+
value_name: 'color',
|
|
6995
|
+
element_label: 'Color',
|
|
6996
|
+
default_value: ''
|
|
6762
6997
|
}, {
|
|
6763
6998
|
element_type: 'radio',
|
|
6764
6999
|
value_name: 'chart',
|
|
@@ -6882,6 +7117,16 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6882
7117
|
legendTooltipTitle: 'Drag one field to further configure your x-axis.',
|
|
6883
7118
|
legendTooltipDescription: 'The breakdown subdivides the chart by a category field for further analysis of what’s contributing to the increase or decrease.',
|
|
6884
7119
|
},
|
|
7120
|
+
[highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH]: {
|
|
7121
|
+
name: 'Waterfall Walkthrough Chart ',
|
|
7122
|
+
label: 'Waterfall Walkthrough Chart ',
|
|
7123
|
+
title: 'TODO: add text',
|
|
7124
|
+
description: 'TODO: add text',
|
|
7125
|
+
axisName: 'Category',
|
|
7126
|
+
startedMessage: 'TODO: add text',
|
|
7127
|
+
axisTooltipTitle: 'TODO: add text',
|
|
7128
|
+
legendTooltipTitle: 'TODO: add text',
|
|
7129
|
+
},
|
|
6885
7130
|
'combo-chart': {
|
|
6886
7131
|
name: 'Combo Chart ',
|
|
6887
7132
|
label: 'Combo Chart ',
|
|
@@ -7537,6 +7782,24 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
7537
7782
|
highchartsRenderer.suboptions["legends"],
|
|
7538
7783
|
]
|
|
7539
7784
|
},
|
|
7785
|
+
{
|
|
7786
|
+
type: highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH,
|
|
7787
|
+
name: highchartsRenderer.chartsTypesInfo[highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH].name,
|
|
7788
|
+
class: 'google-visualization-charteditor-thumbs-columnchart',
|
|
7789
|
+
render: highchartsRenderer.ptRenderWaterfallWalkthrough,
|
|
7790
|
+
suboptions: [
|
|
7791
|
+
highchartsRenderer.suboptions["axisX"],
|
|
7792
|
+
highchartsRenderer.suboptions["tooltips"],
|
|
7793
|
+
highchartsRenderer.suboptions["label"],
|
|
7794
|
+
highchartsRenderer.suboptions["subtitle"],
|
|
7795
|
+
highchartsRenderer.suboptions["widget_library"],
|
|
7796
|
+
highchartsRenderer.suboptions["chart"],
|
|
7797
|
+
highchartsRenderer.suboptions["negative_number_format"],
|
|
7798
|
+
highchartsRenderer.suboptions["advanced"],
|
|
7799
|
+
highchartsRenderer.suboptions["legends"],
|
|
7800
|
+
],
|
|
7801
|
+
hidden: true,
|
|
7802
|
+
},
|
|
7540
7803
|
]
|
|
7541
7804
|
},
|
|
7542
7805
|
];
|
|
@@ -8281,7 +8544,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
8281
8544
|
var data = res;
|
|
8282
8545
|
|
|
8283
8546
|
lodash.forEach(datesFields, function (row) {
|
|
8284
|
-
row.val_not_convert = highchartsRenderer.
|
|
8547
|
+
row.val_not_convert = highchartsRenderer.check_values_not_for_convert(widget, row.name);
|
|
8285
8548
|
});
|
|
8286
8549
|
|
|
8287
8550
|
if (datesFields.length > 0) {
|
|
@@ -8687,14 +8950,14 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
8687
8950
|
return rightPosition;
|
|
8688
8951
|
case 'none':
|
|
8689
8952
|
return none;
|
|
8953
|
+
}
|
|
8954
|
+
} else if (isLine) {
|
|
8955
|
+
return useNewUx ? leftPosition : rightPosition;
|
|
8956
|
+
} else if (isPie) {
|
|
8957
|
+
return useNewUx ? rightPosition : topPosition;
|
|
8690
8958
|
}
|
|
8691
|
-
} else if (isLine) {
|
|
8692
|
-
return useNewUx ? leftPosition : rightPosition;
|
|
8693
|
-
} else if (isPie) {
|
|
8694
|
-
return useNewUx ? rightPosition : topPosition;
|
|
8695
|
-
}
|
|
8696
8959
|
|
|
8697
|
-
|
|
8960
|
+
return useNewUx ? topPosition : bottomPosition;
|
|
8698
8961
|
}
|
|
8699
8962
|
|
|
8700
8963
|
highchartsRenderer.setYAxisMinMax = function (yAxis, axisYOptions) {
|