@datarailsshared/dr_renderer 1.2.230-dragons → 1.2.231
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 +30 -294
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const SERIES_CLASSNAMES = {
|
|
2
2
|
WATERFALL_BREAKDOWN: 'waterfallBreakdown',
|
|
3
|
-
WATERFALL_WALKTHROUGH: 'waterfallWalkthrough',
|
|
4
3
|
TOTAL_SERIES: 'totalSeries',
|
|
5
4
|
TREND_SERIES: 'trendSeries',
|
|
6
5
|
};
|
|
@@ -26,7 +25,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
26
25
|
const textColor = "#151a41";
|
|
27
26
|
const chartLabelColor = "#cfd7dd";
|
|
28
27
|
const HIGHCHARTS_FONT_FAMILY = 'Poppins';
|
|
29
|
-
let firstBarColor = null;
|
|
30
28
|
|
|
31
29
|
if(!Highcharts){
|
|
32
30
|
Highcharts = {
|
|
@@ -84,7 +82,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
84
82
|
KPI_WIDGET: 'kpi-widget',
|
|
85
83
|
TEXT_WIDGET: 'text-widget',
|
|
86
84
|
WATERFALL_BREAKDOWN: 'waterfall-chart-breakdown',
|
|
87
|
-
WATERFALL_WALKTHROUGH: 'waterfall-chart-walkthrough',
|
|
88
85
|
PUBLISHED_ITEM: 'published_item',
|
|
89
86
|
RICH_TEXT: 'rich_text',
|
|
90
87
|
EXCEL_VIEWER: 'excel_viewer',
|
|
@@ -489,7 +486,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
489
486
|
rows = [];
|
|
490
487
|
}
|
|
491
488
|
|
|
492
|
-
var cols =
|
|
489
|
+
var cols = this.key;
|
|
493
490
|
if (typeof (cols) == 'object' && cols.name) {
|
|
494
491
|
cols = cols.name;
|
|
495
492
|
}
|
|
@@ -622,7 +619,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
622
619
|
|
|
623
620
|
var func = function () {
|
|
624
621
|
const isWaterfallBreakdown = this.series.options.className === SERIES_CLASSNAMES.WATERFALL_BREAKDOWN;
|
|
625
|
-
const isWaterfallWalkthrough = this.series.options.className === SERIES_CLASSNAMES.WATERFALL_WALKTHROUGH;
|
|
626
622
|
const isTrendSeries = this.series.options.className === SERIES_CLASSNAMES.TREND_SERIES;
|
|
627
623
|
|
|
628
624
|
var y = parseFloat(this.y);
|
|
@@ -637,8 +633,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
637
633
|
|| isTrendSeries) {
|
|
638
634
|
rows = [];
|
|
639
635
|
}
|
|
640
|
-
|
|
641
|
-
var cols = lodash.get(this, 'point.options.colsForTotal') || this.key;
|
|
636
|
+
var cols = this.key;
|
|
642
637
|
if (!cols && is_drill_down_pie) {
|
|
643
638
|
cols = this.name;
|
|
644
639
|
}
|
|
@@ -653,9 +648,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
653
648
|
if (variant_name && rows && rows[0] && variant_name == rows[0]) {
|
|
654
649
|
rows[0] = variant_name_default_name;
|
|
655
650
|
}
|
|
656
|
-
|
|
657
|
-
cols = [this.key]
|
|
658
|
-
}
|
|
651
|
+
|
|
659
652
|
try {
|
|
660
653
|
if (is_drill_down_pie && !highchartsRenderer.selfStartsWith(series_name,"Series ")) {
|
|
661
654
|
let temp = cols;
|
|
@@ -663,9 +656,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
663
656
|
rows = temp;
|
|
664
657
|
}
|
|
665
658
|
|
|
666
|
-
var category_text = `<span style="font-weight: bold;"
|
|
667
|
-
${ lodash.get(this, 'point.options.colsForTotal') ? cols[0] : cols } ${ isWaterfallBreakdown ? ': ' : ' ' }
|
|
668
|
-
</span>`;
|
|
659
|
+
var category_text = `<span style="font-weight: bold;">${ cols }${ isWaterfallBreakdown ? ': ' : ' ' }</span>`;
|
|
669
660
|
if (this.category) {
|
|
670
661
|
category_text = '';
|
|
671
662
|
}
|
|
@@ -1046,7 +1037,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1046
1037
|
if (row_n_value && row_n_value.length > 0) {
|
|
1047
1038
|
ob.name = row_n_value.join(highchartsRenderer.delimer).replace('DR_Others', othersName);
|
|
1048
1039
|
}
|
|
1049
|
-
|
|
1050
1040
|
lodash.forEach(col_n_keys, function (col_n_value, index) {
|
|
1051
1041
|
var agg = pivotData.getAggregator(row_n_value, col_n_value);
|
|
1052
1042
|
var val = agg.value();
|
|
@@ -1263,7 +1253,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1263
1253
|
if (opts.trendLine) {
|
|
1264
1254
|
const a = ((ySum * squareXSum) - (xSum * xySum)) / ((n * squareXSum) - (xSum * xSum));
|
|
1265
1255
|
const b = ((n * xySum) - (xSum* ySum)) / ((n * squareXSum) - (xSum * xSum));
|
|
1266
|
-
|
|
1267
1256
|
const trendSeries = lodash.clone(chart_series[chart_series.length - 1]);
|
|
1268
1257
|
trendSeries.className = 'trendSeries';
|
|
1269
1258
|
trendSeries.name = highchartsRenderer.getTrendSeriesName(trendSeries);
|
|
@@ -1274,7 +1263,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1274
1263
|
if (colors && colors[i]) {
|
|
1275
1264
|
trendSeries.color = colors[i];
|
|
1276
1265
|
}
|
|
1277
|
-
|
|
1278
1266
|
trendSerieses.push(trendSeries);
|
|
1279
1267
|
}
|
|
1280
1268
|
i++;
|
|
@@ -1291,7 +1279,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1291
1279
|
}
|
|
1292
1280
|
|
|
1293
1281
|
let weights = { line: 2,spline: 3 ,area:-2, areaspline: -1, scatter:4, column: 1 };
|
|
1294
|
-
|
|
1295
1282
|
if (opts.comboOptions && lodash.includes(chartType,'combo') && !lodash.isEqual(row_n_keys, EMPTY_ROW_N_KEYS)) {
|
|
1296
1283
|
chart_series.forEach((series, seriesIndex) => {
|
|
1297
1284
|
const savedSeriesOption = lodash.find(opts.comboOptions.seriesOptions, {series: series.name});
|
|
@@ -1426,89 +1413,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1426
1413
|
return chart_series;
|
|
1427
1414
|
}
|
|
1428
1415
|
|
|
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
|
-
|
|
1512
1416
|
highchartsRenderer.setChartTypeBySeriesType = function (type, series) {
|
|
1513
1417
|
const types = {
|
|
1514
1418
|
'line-chart': 'line',
|
|
@@ -3367,121 +3271,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
3367
3271
|
return highchartsRenderer.ptCreateElementAndDraw(chartOptions, opts);
|
|
3368
3272
|
};
|
|
3369
3273
|
|
|
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
|
-
|
|
3485
3274
|
highchartsRenderer.formatFieldValue = function (field, value) {
|
|
3486
3275
|
let currentType = '';
|
|
3487
3276
|
let format = field.format;
|
|
@@ -4550,17 +4339,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
4550
4339
|
}
|
|
4551
4340
|
};
|
|
4552
4341
|
|
|
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
|
-
|
|
4564
4342
|
highchartsRenderer.rhPivotView = function (rowData, options, isTable = false, widget = null) {
|
|
4565
4343
|
if (!rowData || !rowData) {
|
|
4566
4344
|
if (options.onlyOptions) {
|
|
@@ -4569,15 +4347,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
4569
4347
|
return null;
|
|
4570
4348
|
}
|
|
4571
4349
|
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
);
|
|
4577
|
-
|
|
4578
|
-
if (isWaterfall) {
|
|
4579
|
-
const maxCategories = highchartsRenderer.waterfallConstants[widget.chart_type].maxCategoriesCount;
|
|
4580
|
-
const minCategories = highchartsRenderer.waterfallConstants[widget.chart_type].minCategoriesCount;
|
|
4350
|
+
if (widget && widget.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN) {
|
|
4351
|
+
const breakdownSettings = widget.options.breakdown_options.settings;
|
|
4352
|
+
const maxCategories = breakdownSettings.maxCategoriesCount;
|
|
4353
|
+
const minCategories = breakdownSettings.minCategoriesCount;
|
|
4581
4354
|
const uniqueCategories = lodash.filter(
|
|
4582
4355
|
lodash.uniq(
|
|
4583
4356
|
lodash.map(rowData, row => row[widget.cols[0].name])
|
|
@@ -4587,8 +4360,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
4587
4360
|
|
|
4588
4361
|
if (uniqueCategories && (uniqueCategories.length > maxCategories || uniqueCategories.length < minCategories )) {
|
|
4589
4362
|
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. `;
|
|
4592
4363
|
options.error_params = {
|
|
4593
4364
|
title: 'Data Conflict',
|
|
4594
4365
|
text: `Please adjust your dashboard's reference date and filter selections as \
|
|
@@ -4837,25 +4608,19 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
4837
4608
|
return highchartsRenderer.getWeekNumber(dateObj);
|
|
4838
4609
|
};
|
|
4839
4610
|
|
|
4840
|
-
highchartsRenderer.
|
|
4841
|
-
let
|
|
4611
|
+
highchartsRenderer.check_value_not_for_convert = function (currentgraph, field_name) {
|
|
4612
|
+
let val_not_convert = null;
|
|
4842
4613
|
if (lodash.has(currentgraph, "options.chartOptions.delta_column") && currentgraph.options.chartOptions.delta_column) {
|
|
4843
4614
|
let delta_options = currentgraph.options.chartOptions.delta_column;
|
|
4844
4615
|
if (delta_options.field == 'series' && currentgraph.rows && currentgraph.rows[0] &&
|
|
4845
4616
|
currentgraph.rows[0].name == field_name) {
|
|
4846
|
-
|
|
4617
|
+
val_not_convert = delta_options.name;
|
|
4847
4618
|
} else if (delta_options.field == 'category' && currentgraph.rows && currentgraph.cols[0] &&
|
|
4848
4619
|
currentgraph.cols[0].name == field_name) {
|
|
4849
|
-
|
|
4620
|
+
val_not_convert = delta_options.name;
|
|
4850
4621
|
}
|
|
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
|
-
});
|
|
4857
4622
|
}
|
|
4858
|
-
return
|
|
4623
|
+
return val_not_convert;
|
|
4859
4624
|
};
|
|
4860
4625
|
|
|
4861
4626
|
highchartsRenderer.updateFiltersShowNames = function (filters) {
|
|
@@ -4875,8 +4640,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
4875
4640
|
})
|
|
4876
4641
|
};
|
|
4877
4642
|
|
|
4878
|
-
highchartsRenderer.returnRawDataValue = function (type, value, format, field_name,
|
|
4879
|
-
if (
|
|
4643
|
+
highchartsRenderer.returnRawDataValue = function (type, value, format, field_name, val_not_for_convert) {
|
|
4644
|
+
if (val_not_for_convert && val_not_for_convert == value) {
|
|
4880
4645
|
return value;
|
|
4881
4646
|
}
|
|
4882
4647
|
|
|
@@ -6984,16 +6749,16 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6984
6749
|
value_name: 'name',
|
|
6985
6750
|
element_label: 'Name',
|
|
6986
6751
|
default_value: '_Variance'
|
|
6987
|
-
}, {
|
|
6988
|
-
element_type: 'input',
|
|
6989
|
-
value_name: 'formula',
|
|
6990
|
-
element_label: 'Formula',
|
|
6991
|
-
default_value: 'x2-x1'
|
|
6992
6752
|
}, {
|
|
6993
6753
|
element_type: 'input',
|
|
6994
|
-
value_name: '
|
|
6995
|
-
element_label: '
|
|
6996
|
-
default_value: ''
|
|
6754
|
+
value_name: 'formula',
|
|
6755
|
+
element_label: 'Formula',
|
|
6756
|
+
default_value: 'x2-x1'
|
|
6757
|
+
}, {
|
|
6758
|
+
element_type: 'input',
|
|
6759
|
+
value_name: 'color',
|
|
6760
|
+
element_label: 'Color',
|
|
6761
|
+
default_value: ''
|
|
6997
6762
|
}, {
|
|
6998
6763
|
element_type: 'radio',
|
|
6999
6764
|
value_name: 'chart',
|
|
@@ -7117,16 +6882,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
7117
6882
|
legendTooltipTitle: 'Drag one field to further configure your x-axis.',
|
|
7118
6883
|
legendTooltipDescription: 'The breakdown subdivides the chart by a category field for further analysis of what’s contributing to the increase or decrease.',
|
|
7119
6884
|
},
|
|
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
|
-
},
|
|
7130
6885
|
'combo-chart': {
|
|
7131
6886
|
name: 'Combo Chart ',
|
|
7132
6887
|
label: 'Combo Chart ',
|
|
@@ -7782,24 +7537,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
7782
7537
|
highchartsRenderer.suboptions["legends"],
|
|
7783
7538
|
]
|
|
7784
7539
|
},
|
|
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
|
-
},
|
|
7803
7540
|
]
|
|
7804
7541
|
},
|
|
7805
7542
|
];
|
|
@@ -8544,7 +8281,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
8544
8281
|
var data = res;
|
|
8545
8282
|
|
|
8546
8283
|
lodash.forEach(datesFields, function (row) {
|
|
8547
|
-
row.val_not_convert = highchartsRenderer.
|
|
8284
|
+
row.val_not_convert = highchartsRenderer.check_value_not_for_convert(widget, row.name);
|
|
8548
8285
|
});
|
|
8549
8286
|
|
|
8550
8287
|
if (datesFields.length > 0) {
|
|
@@ -8950,14 +8687,14 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
8950
8687
|
return rightPosition;
|
|
8951
8688
|
case 'none':
|
|
8952
8689
|
return none;
|
|
8953
|
-
}
|
|
8954
|
-
} else if (isLine) {
|
|
8955
|
-
return useNewUx ? leftPosition : rightPosition;
|
|
8956
|
-
} else if (isPie) {
|
|
8957
|
-
return useNewUx ? rightPosition : topPosition;
|
|
8958
8690
|
}
|
|
8691
|
+
} else if (isLine) {
|
|
8692
|
+
return useNewUx ? leftPosition : rightPosition;
|
|
8693
|
+
} else if (isPie) {
|
|
8694
|
+
return useNewUx ? rightPosition : topPosition;
|
|
8695
|
+
}
|
|
8959
8696
|
|
|
8960
|
-
|
|
8697
|
+
return useNewUx ? topPosition : bottomPosition;
|
|
8961
8698
|
}
|
|
8962
8699
|
|
|
8963
8700
|
highchartsRenderer.setYAxisMinMax = function (yAxis, axisYOptions) {
|
|
@@ -9027,7 +8764,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
9027
8764
|
}
|
|
9028
8765
|
|
|
9029
8766
|
return highchartsRenderer;
|
|
9030
|
-
|
|
9031
8767
|
};
|
|
9032
8768
|
|
|
9033
8769
|
module.exports = getHighchartsRenderer;
|