@datarailsshared/dr_renderer 1.2.243 → 1.2.245-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 +10 -8
package/package.json
CHANGED
|
@@ -1042,6 +1042,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1042
1042
|
if (row_n_value && row_n_value.length > 0) {
|
|
1043
1043
|
ob.name = row_n_value.join(highchartsRenderer.delimer).replace('DR_Others', othersName);
|
|
1044
1044
|
}
|
|
1045
|
+
|
|
1045
1046
|
lodash.forEach(col_n_keys, function (col_n_value, index) {
|
|
1046
1047
|
var agg = pivotData.getAggregator(row_n_value, col_n_value);
|
|
1047
1048
|
var val = agg.value();
|
|
@@ -1258,6 +1259,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1258
1259
|
if (opts.trendLine) {
|
|
1259
1260
|
const a = ((ySum * squareXSum) - (xSum * xySum)) / ((n * squareXSum) - (xSum * xSum));
|
|
1260
1261
|
const b = ((n * xySum) - (xSum* ySum)) / ((n * squareXSum) - (xSum * xSum));
|
|
1262
|
+
|
|
1261
1263
|
const trendSeries = lodash.clone(chart_series[chart_series.length - 1]);
|
|
1262
1264
|
trendSeries.className = 'trendSeries';
|
|
1263
1265
|
trendSeries.name = highchartsRenderer.getTrendSeriesName(trendSeries);
|
|
@@ -1268,6 +1270,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1268
1270
|
if (colors && colors[i]) {
|
|
1269
1271
|
trendSeries.color = colors[i];
|
|
1270
1272
|
}
|
|
1273
|
+
|
|
1271
1274
|
trendSerieses.push(trendSeries);
|
|
1272
1275
|
}
|
|
1273
1276
|
i++;
|
|
@@ -1284,6 +1287,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1284
1287
|
}
|
|
1285
1288
|
|
|
1286
1289
|
let weights = { line: 2,spline: 3 ,area:-2, areaspline: -1, scatter:4, column: 1 };
|
|
1290
|
+
|
|
1287
1291
|
if (opts.comboOptions && lodash.includes(chartType,'combo') && !lodash.isEqual(row_n_keys, EMPTY_ROW_N_KEYS)) {
|
|
1288
1292
|
chart_series.forEach((series, seriesIndex) => {
|
|
1289
1293
|
const savedSeriesOption = lodash.find(opts.comboOptions.seriesOptions, {series: series.name});
|
|
@@ -1429,8 +1433,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1429
1433
|
formatter: highchartsRenderer.defaultDataLabelFormatter(pivotData, {'chartOptions': additionOptions, total_value_options: opts.total_value_options}),
|
|
1430
1434
|
style: highchartsRenderer.getDataLabelsStyle(additionOptions),
|
|
1431
1435
|
},
|
|
1432
|
-
upColor:
|
|
1433
|
-
color: waterfallOptions
|
|
1436
|
+
upColor: lodash.get(waterfallOptions, 'colors.increase'),
|
|
1437
|
+
color: lodash.get(waterfallOptions, 'colors.decrease'),
|
|
1434
1438
|
className: SERIES_CLASSNAMES.WATERFALL_WALKTHROUGH
|
|
1435
1439
|
};
|
|
1436
1440
|
resultObject = highchartsRenderer.getDataLabelsOptions(additionOptions, resultObject);
|
|
@@ -1466,9 +1470,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1466
1470
|
if (value.color) {
|
|
1467
1471
|
color = value.color;
|
|
1468
1472
|
} else {
|
|
1469
|
-
|
|
1470
|
-
if (value.trend === 'decrease') color = waterfallOptions.colors.decrease;
|
|
1471
|
-
if (value.trend === 'increase') color = waterfallOptions.colors.increase;
|
|
1473
|
+
color = lodash.get(waterfallOptions, 'colors', {})[value.trend];
|
|
1472
1474
|
}
|
|
1473
1475
|
|
|
1474
1476
|
resultObject.data.push({
|
|
@@ -1485,14 +1487,14 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1485
1487
|
{
|
|
1486
1488
|
name: 'Positive',
|
|
1487
1489
|
visible: false,
|
|
1488
|
-
color: waterfallOptions
|
|
1490
|
+
color: lodash.get(waterfallOptions, 'colors.increase')
|
|
1489
1491
|
});
|
|
1490
1492
|
|
|
1491
1493
|
chart_series.push(
|
|
1492
1494
|
{
|
|
1493
1495
|
name: 'Negative',
|
|
1494
1496
|
visible: false,
|
|
1495
|
-
color: waterfallOptions
|
|
1497
|
+
color: lodash.get(waterfallOptions, 'colors.decrease'),
|
|
1496
1498
|
});
|
|
1497
1499
|
|
|
1498
1500
|
return chart_series;
|
|
@@ -5219,7 +5221,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
5219
5221
|
|
|
5220
5222
|
// TODO: remove this logic after BE sort is implemented
|
|
5221
5223
|
// it is required to do sort by totals for comparative analysis - we need to change deltas if columns swaped vice versa
|
|
5222
|
-
const isTwoColumnComparisonWidget = widgetOptions.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN
|
|
5224
|
+
const isTwoColumnComparisonWidget = widgetOptions.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN
|
|
5223
5225
|
&& lodash.get(widgetOptions, 'options.breakdown_options.values.totals', []).length === 2;
|
|
5224
5226
|
|
|
5225
5227
|
if (isTwoColumnComparisonWidget) {
|