mirror of
https://github.com/apache/superset.git
synced 2026-05-07 17:04:58 +00:00
feat(stack by dimension): add a stack by dimension dropdown list (#32707)
Co-authored-by: CAPELLI Giampaolo <giampaolo.capelli@docaposte.fr>
This commit is contained in:
committed by
GitHub
parent
875f538d54
commit
5b2f1bbf9e
@@ -191,6 +191,7 @@ export default function transformProps(
|
||||
yAxisTitleMargin,
|
||||
yAxisTitlePosition,
|
||||
zoomable,
|
||||
stackDimension,
|
||||
}: EchartsTimeseriesFormData = { ...DEFAULT_FORM_DATA, ...formData };
|
||||
const refs: Refs = {};
|
||||
const groupBy = ensureIsArray(groupby);
|
||||
@@ -418,6 +419,23 @@ export default function transformProps(
|
||||
}
|
||||
});
|
||||
|
||||
if (
|
||||
stack === StackControlsValue.Stack &&
|
||||
stackDimension &&
|
||||
chartProps.rawFormData.groupby
|
||||
) {
|
||||
const idxSelectedDimension =
|
||||
formData.metrics.length > 1
|
||||
? 1
|
||||
: 0 + chartProps.rawFormData.groupby.indexOf(stackDimension);
|
||||
for (const s of series) {
|
||||
if (s.id) {
|
||||
const columnsArr = labelMap[s.id];
|
||||
(s as any).stack = columnsArr[idxSelectedDimension];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// axis bounds need to be parsed to replace incompatible values with undefined
|
||||
const [xAxisMin, xAxisMax] = (xAxisBounds || []).map(parseAxisBound);
|
||||
let [yAxisMin, yAxisMax] = (yAxisBounds || []).map(parseAxisBound);
|
||||
|
||||
Reference in New Issue
Block a user