mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
feat(charts): add subtitle option and metric customization controls (#32975)
This commit is contained in:
@@ -494,6 +494,7 @@ const config: ControlPanelConfig = {
|
||||
chart?.queriesResponse?.[0] ?? {};
|
||||
let colnames: string[] = _colnames || [];
|
||||
let coltypes: GenericDataType[] = _coltypes || [];
|
||||
const childColumnMap: Record<string, boolean> = {};
|
||||
|
||||
if (timeComparisonStatus) {
|
||||
/**
|
||||
@@ -501,15 +502,27 @@ const config: ControlPanelConfig = {
|
||||
*/
|
||||
const updatedColnames: string[] = [];
|
||||
const updatedColtypes: GenericDataType[] = [];
|
||||
|
||||
colnames.forEach((colname, index) => {
|
||||
if (coltypes[index] === GenericDataType.Numeric) {
|
||||
updatedColnames.push(
|
||||
...generateComparisonColumns(colname),
|
||||
);
|
||||
updatedColtypes.push(...generateComparisonColumnTypes(4));
|
||||
const comparisonColumns =
|
||||
generateComparisonColumns(colname);
|
||||
comparisonColumns.forEach((name, idx) => {
|
||||
updatedColnames.push(name);
|
||||
updatedColtypes.push(
|
||||
...generateComparisonColumnTypes(4),
|
||||
);
|
||||
|
||||
if (idx === 0 && name.startsWith('Main ')) {
|
||||
childColumnMap[name] = false;
|
||||
} else {
|
||||
childColumnMap[name] = true;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
updatedColnames.push(colname);
|
||||
updatedColtypes.push(coltypes[index]);
|
||||
childColumnMap[colname] = false;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -517,7 +530,7 @@ const config: ControlPanelConfig = {
|
||||
coltypes = updatedColtypes;
|
||||
}
|
||||
return {
|
||||
columnsPropsObject: { colnames, coltypes },
|
||||
columnsPropsObject: { colnames, coltypes, childColumnMap },
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user