@datarailsshared/dr_renderer 1.2.156 → 1.2.158-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 +26 -18
package/package.json
CHANGED
|
@@ -7581,6 +7581,9 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
7581
7581
|
}
|
|
7582
7582
|
|
|
7583
7583
|
let filters = [];
|
|
7584
|
+
|
|
7585
|
+
this.formatDatesWithAggregationIfRequired(widget, null);
|
|
7586
|
+
|
|
7584
7587
|
lodash.forEach(col_key, function (col_value, index) {
|
|
7585
7588
|
if (widget && widget.cols[index]) {
|
|
7586
7589
|
let temp = highchartsRenderer.createFilterObject(widget.cols[index]);
|
|
@@ -7783,10 +7786,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
7783
7786
|
datesFields = lodash.filter(widget.rows, element => element.type == 'Date');
|
|
7784
7787
|
datesFields = datesFields.concat(lodash.filter(widget.cols, element => element.type == 'Date'));
|
|
7785
7788
|
|
|
7786
|
-
|
|
7787
|
-
if (aggregationConfigs.length && datesFields && datesFields.length) {
|
|
7788
|
-
highchartsRenderer.formatDatesWithAggregationIfRequired(aggregationConfigs, datesFields, defaultDateFormat);
|
|
7789
|
-
}
|
|
7789
|
+
highchartsRenderer.formatDatesWithAggregationIfRequired(widget, defaultDateFormat);
|
|
7790
7790
|
|
|
7791
7791
|
const isCustomSorting = widget.options.sortingFields && Array.isArray(widget.options.sortingFields) && widget.options.sortingFields.length > 0;
|
|
7792
7792
|
if (isCustomSorting) {
|
|
@@ -7887,7 +7887,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
7887
7887
|
widget.options.chartOptions.delta_column.sort_by_absolute_variance) &&
|
|
7888
7888
|
widget.rows.length > 0 &&
|
|
7889
7889
|
widget.cols.length > 0 &&
|
|
7890
|
-
widget.vals.length
|
|
7890
|
+
widget.vals.length > 0
|
|
7891
7891
|
) {
|
|
7892
7892
|
let variance_config = widget.options.chartOptions.delta_column;
|
|
7893
7893
|
let val_field = widget.vals[0];
|
|
@@ -8216,21 +8216,29 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
8216
8216
|
yAxis.max = !isNaN(maxNumber) ? maxNumber : null;
|
|
8217
8217
|
}
|
|
8218
8218
|
|
|
8219
|
-
highchartsRenderer.formatDatesWithAggregationIfRequired = function(
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8219
|
+
highchartsRenderer.formatDatesWithAggregationIfRequired = function(widget, defaultDateFormat) {
|
|
8220
|
+
|
|
8221
|
+
let datesFields = [];
|
|
8222
|
+
datesFields = lodash.filter(widget.rows, element => element.type == 'Date');
|
|
8223
|
+
datesFields = datesFields.concat(lodash.filter(widget.cols, element => element.type == 'Date'));
|
|
8224
|
+
const aggregationConfigs = widget.options ? widget.options.date_aggregation_configs || [] : [];
|
|
8223
8225
|
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
if (
|
|
8230
|
-
dateField
|
|
8226
|
+
if (aggregationConfigs.length && datesFields && datesFields.length) {
|
|
8227
|
+
_.forEach(aggregationConfigs, aggregationConfig => {
|
|
8228
|
+
const aggregationTimeframe = aggregationConfig ? aggregationConfig.aggregate_by : null;
|
|
8229
|
+
const isFormattingByAggregation = aggregationConfig ? aggregationConfig.is_formatting_by_aggregation_method : false;
|
|
8230
|
+
|
|
8231
|
+
if (aggregationTimeframe && isFormattingByAggregation) {
|
|
8232
|
+
const dateField = lodash.find(
|
|
8233
|
+
datesFields,
|
|
8234
|
+
(element) => element.id === aggregationConfig.field_id
|
|
8235
|
+
);
|
|
8236
|
+
if (dateField) {
|
|
8237
|
+
dateField.format = highchartsRenderer.getDateFormatByAggregation(aggregationTimeframe, defaultDateFormat);
|
|
8238
|
+
}
|
|
8231
8239
|
}
|
|
8232
|
-
}
|
|
8233
|
-
}
|
|
8240
|
+
});
|
|
8241
|
+
}
|
|
8234
8242
|
}
|
|
8235
8243
|
|
|
8236
8244
|
highchartsRenderer.getDateFormatByAggregation = function(timeframe, defaultDateFormat) {
|