sea-chart 1.1.87-alpha.1 → 1.1.87
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.
|
@@ -237,7 +237,10 @@ async function calculateTwoDimensionTable(chart, value, _ref2) {
|
|
|
237
237
|
const isGroupbyColumnDataAsAnArray = isArrayCellValue(groupbyColumn);
|
|
238
238
|
const rowGroupbyColumn = getTableColumnByKey(table, column_groupby_column_key);
|
|
239
239
|
if (!rowGroupbyColumn) {
|
|
240
|
-
return calculateOneDimensionTable(chart, value
|
|
240
|
+
return calculateOneDimensionTable(chart, value, {
|
|
241
|
+
getViewRows,
|
|
242
|
+
getTableFormulaResults
|
|
243
|
+
});
|
|
241
244
|
}
|
|
242
245
|
const isRowGroupbyColumnDataAsAnArray = isArrayCellValue(rowGroupbyColumn);
|
|
243
246
|
const statRows = await getViewRows(view, table);
|
|
@@ -4,7 +4,7 @@ import { debounce, maxBy } from 'lodash-es';
|
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { CellType } from 'dtable-utils';
|
|
6
6
|
import dayjs from 'dayjs';
|
|
7
|
-
import { CHART_TYPE, EMPTY_NAME, CHART_THEME_COLOR, CHART_STYLE_COLORS } from '../../constants';
|
|
7
|
+
import { CHART_TYPE, EMPTY_NAME, CHART_THEME_COLOR, CHART_STYLE_COLORS, CHART_DATA_SORT_TYPE } from '../../constants';
|
|
8
8
|
import { BaseUtils, isFunction } from '../../utils';
|
|
9
9
|
import intl from '../../intl';
|
|
10
10
|
import { SUPPORT_SINGLE_SELECT_THEMES_OPTIONS } from '../../constants/color-rules';
|
|
@@ -51,11 +51,17 @@ class HorizontalBarGroup extends HorizontalComponent {
|
|
|
51
51
|
this.chart.scale(this.groupName, {
|
|
52
52
|
type: 'cat'
|
|
53
53
|
});
|
|
54
|
-
|
|
54
|
+
let {
|
|
55
55
|
sort_type,
|
|
56
56
|
type
|
|
57
57
|
} = chart.config;
|
|
58
58
|
if (type === CHART_TYPE.STACKED_HORIZONTAL_BAR && sort_type) {
|
|
59
|
+
// use the opposite sort type for stacked horizontal bar
|
|
60
|
+
if (sort_type === CHART_DATA_SORT_TYPE.DESCENDING) {
|
|
61
|
+
sort_type = CHART_DATA_SORT_TYPE.ASCENDING;
|
|
62
|
+
} else {
|
|
63
|
+
sort_type = CHART_DATA_SORT_TYPE.DESCENDING;
|
|
64
|
+
}
|
|
59
65
|
data = sortDataByGroupSum(data, sort_type);
|
|
60
66
|
}
|
|
61
67
|
this.loadData(data);
|