@datarailsshared/dr_renderer 1.2.348 → 1.2.350
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 +12 -7
package/package.json
CHANGED
@@ -8878,15 +8878,20 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
8878
8878
|
|
8879
8879
|
// if it is breakdown widget - redefine sorting according to breakdown_options
|
8880
8880
|
// TODO: remove this when BE sort will be implemented
|
8881
|
+
const isTwoColumnComparisonWidget = lodash.get(widget, 'options.breakdown_options.values.totals', []).length === 2;
|
8881
8882
|
lodash.forEach(rowsAndCols, function (field) {
|
8882
8883
|
const waterfallFieldType = field.id === widget.cols[0].id ? 'totals' : 'breakdown';
|
8883
|
-
|
8884
|
-
|
8885
|
-
|
8886
|
-
|
8887
|
-
|
8888
|
-
|
8889
|
-
|
8884
|
+
if (waterfallFieldType !== 'totals' || isTwoColumnComparisonWidget) {
|
8885
|
+
field.sorting = {
|
8886
|
+
type: 'CustomOrder',
|
8887
|
+
values: lodash.map(
|
8888
|
+
widget.options.breakdown_options.values[waterfallFieldType],
|
8889
|
+
value => value.key
|
8890
|
+
),
|
8891
|
+
};
|
8892
|
+
} else {
|
8893
|
+
field.sorting = null;
|
8894
|
+
}
|
8890
8895
|
});
|
8891
8896
|
} else if (isCustomSorting) {
|
8892
8897
|
lodash.forEach(rowsAndCols, function (field) {
|