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